Skip to content

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

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

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

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: "${IMAGE}:${{ github.sha }}"
BUILDIMAGE_ARTIFACT: "${BUILDIMAGE}.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 > ${BUILDIMAGE_ARTIFACT}
- name: upload-image
uses: actions/upload-artifact@v4
with:
name: ${BUILDIMAGE_ARTIFACT}
path: /tmp/${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 }}
image_artifact: ${{ steps.return-image-name.outputs.imageArtifact }}
go-checks:
needs: build-dev-image
runs-on: ubuntu-22.04
steps:
- name: download-image
uses: actions/download-artifact@v4
with:
name: ${{needs.build-dev-image.outputs.imageArtifact}}
path: /tmp
- name: load-image
run: docker load -i /tmp/${{needs.build-dev-image.outputs.imageArtifact}}
- uses: actions/checkout@v4
container: ${{needs.build-dev-image.outputs.image}}

Check failure on line 56 in .github/workflows/ci.yaml

View workflow run for this annotation

GitHub Actions / CI

Invalid workflow file

The workflow is not valid. .github/workflows/ci.yaml (Line: 56, Col: 7): Unexpected value 'container' .github/workflows/ci.yaml (Line: 58, Col: 7): Unexpected value 'container'
- name: fmt
container: ${{needs.build-dev-image.outputs.image}}
run: make assert-fmt
- name: vet
container: ${{needs.build-dev-image.outputs.image}}
run: make vet
- name: lint
container: ${{needs.build-dev-image.outputs.image}}
run: make lint
- name: ineffassign
container: ${{needs.build-dev-image.outputs.image}}
run: make ineffassign
- name: misspell
container: ${{needs.build-dev-image.outputs.image}}
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