Skip to content

Add GitHub Actions to map the existing GitLab CI/CD config #30

Add GitHub Actions to map the existing GitLab CI/CD config

Add GitHub Actions to map the existing GitLab CI/CD config #30

Workflow file for this run

# Copyright (c) 2023, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: "CI"
on: [push, pull_request]
jobs:
build-dev-image:
runs-on: ubuntu-22.04
env:
IMAGE: build-image
IMAGE_TAG: "${{ github.sha }}"
BUILDIMAGE: "build-image:${{ github.sha }}"
BUILDIMAGE_ARTIFACT: "build-image.tar.gz"
steps:
#- uses: actions/checkout@v4
#- name: build-dev-image
#run: make .build-image
#- name: export-image-to-targz
#run: docker save ${BUILDIMAGE} | gzip > /tmp/${BUILDIMAGE_ARTIFACT}
#- name: upload-image
#uses: actions/upload-artifact@v4
#with:
#name: image
#path: /tmp/${{ env.BUILDIMAGE_ARTIFACT }}
- name: return-image-name
run: |
echo "image=${BUILDIMAGE}" >> "$GITHUB_OUTPUT"
echo "imageArtifact=${BUILDIMAGE_ARTIFACT}" >> "$GITHUB_OUTPUT"
outputs:
image: ${{ steps.return-image-name.outputs.image }}
imageArtifact: ${{ steps.return-image-name.outputs.imageArtifact }}
go-checks:
needs: build-dev-image
runs-on: ubuntu-22.04
#container: ${{ needs.build-dev-image.outputs.image }}
steps:
- name:
run: |
echo ${{needs.build-dev-image.outputs.image}}
echo ${{needs.build-dev-image.outputs.imageArtifact}}
echo ${{needs.build-dev-image.outputs}}
- name: download-image
uses: actions/download-artifact@v4
with:
name: image
path: /tmp
- name: load-image
run: docker load -i /tmp/${{ needs.build-dev-image.outputs.imageArtifact }}
- uses: actions/checkout@v4
- name: fmt
run: make assert-fmt
- name: vet
run: make vet
- name: lint
run: make lint
- name: ineffassign
run: make ineffassign
- name: misspell
run: make misspell
go-build:
needs: go-checks
runs-on: ubuntu-22.04
container: ${{needs.build-dev-image.outputs.image}}
steps:
- uses: actions/checkout@v4
- name: build
run: make build
unit-tests:
needs: go-build
runs-on: ubuntu-22.04
container: ${{needs.build-dev-image.outputs.image}}
steps:
- uses: actions/checkout@v4
- name: unit-tests
run: make test