Skip to content

chore: upgrade actions #692

chore: upgrade actions

chore: upgrade actions #692

Workflow file for this run

name: ci
on:
pull_request:
branches:
- main
- release-*
jobs:
pull:
strategy:
fail-fast: false
matrix:
arch: [amd64, arm64]
job:
- verify
- build
- unit-test
- integration-test
runs-on: ${{ fromJson('{"amd64":"ubuntu-latest", "arm64":["self-hosted", "Linux", "ARM64"]}')[matrix.arch] }}
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
path: go/src/github.com/${{ github.repository }}
- name: Set up Go 1.18
uses: actions/setup-go@v4
with:
go-version: 1.20.x
id: go
- name: ${{ matrix.job }}
run: |
# use sh function
if [[ "$job" == "verify" ]]; then
# preload go modules before goimports
go mod download -x
make check
make groupimports || echo 0
echo "Please make check before creating a PR"
git diff --quiet -- . || (git diff | cat && false)
elif [[ "$job" == "build" ]]; then
make build
elif [[ "$job" == "unit-test" ]]; then
make unit-test
elif [[ "$job" == "integration-test" ]]; then
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y stress-ng
make integration-test
else
make $job
fi
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
env:
job: ${{ matrix.job }}