Update from update/networkservicemesh/sdk-k8s #848
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: ci | |
on: | |
push: | |
branches: | |
- 'main' | |
- 'release/**' | |
pull_request: | |
jobs: | |
yamllint: | |
uses: networkservicemesh/.github/.github/workflows/yamllint.yaml@main | |
with: | |
config_file: "./.yamllint.yml" | |
shellcheck: | |
uses: networkservicemesh/.github/.github/workflows/shellcheck.yaml@main | |
build: | |
name: build | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
steps: | |
- name: Check out code | |
uses: actions/checkout@v2 | |
- name: Setup Go | |
uses: actions/setup-go@v1 | |
with: | |
go-version: 1.20.5 | |
- name: Build | |
run: go build -race ./... | |
golangci-lint: | |
uses: networkservicemesh/.github/.github/workflows/golangci-lint.yaml@main | |
excludeFmtErrorf: | |
uses: networkservicemesh/.github/.github/workflows/exclude-fmt-errorf.yaml@main | |
restrictNSMDeps: | |
uses: networkservicemesh/.github/.github/workflows/restrict-nsm-deps.yaml@main | |
with: | |
allowed_repositories: "api, sdk, sdk-k8s, sdk-ovs, sdk-sriov, sdk-kernel" | |
checkgomod: | |
uses: networkservicemesh/.github/.github/workflows/checkgomod.yaml@main | |
gogenerate: | |
uses: networkservicemesh/.github/.github/workflows/cmd-gogenerate.yaml@main | |
excludereplace: | |
uses: networkservicemesh/.github/.github/workflows/exclude-replace.yaml@main | |
docker: | |
name: Docker Build & Test | |
runs-on: ubuntu-latest | |
if: github.repository != 'networkservicemesh/cmd-template' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: actions/setup-go@v1 | |
with: | |
go-version: 1.20.5 | |
- name: Build container | |
run: docker build . | |
- name: Run tests | |
run: docker run --privileged --rm $(docker build -q . --target test) | |
- name: Find merged PR | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
uses: jwalton/gh-find-current-pr@v1 | |
id: findPr | |
with: | |
github-token: ${{ github.token }} | |
- name: Publish Image | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && success() && steps.findPr.outputs.number | |
uses: matootie/github-docker@v3.0.0 | |
with: | |
accessToken: ${{ github.token }} | |
tag: | | |
pr-${{ steps.findPr.outputs.pr }} | |
commit-${{ github.sha }} | |
latest |