From 6bbcc97bd4aa645cddb8e91dc82406a41c0a31c9 Mon Sep 17 00:00:00 2001 From: Sun Yimin Date: Wed, 8 Mar 2023 13:42:46 +0800 Subject: [PATCH] Create test_qemu.yml --- .github/workflows/test_qemu.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/test_qemu.yml diff --git a/.github/workflows/test_qemu.yml b/.github/workflows/test_qemu.yml new file mode 100644 index 0000000..3998b8d --- /dev/null +++ b/.github/workflows/test_qemu.yml @@ -0,0 +1,48 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: test-qemu + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + + test: + strategy: + matrix: + go-version: [1.18.x] + arch: [arm64] + runs-on: ubuntu-latest + steps: + - name: Set up Go + uses: actions/setup-go@v3 + with: + go-version: ${{ matrix.go-version }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v2 + + - name: Check out code + uses: actions/checkout@v3 + + - name: Setup Environment + run: | + echo "GOPATH=$(go env GOPATH)" >> $GITHUB_ENV + echo "$(go env GOPATH)/bin" >> $GITHUB_PATH + + - name: Module cache + uses: actions/cache@v3 + env: + cache-name: go-mod-cache + with: + path: ~/go/pkg/mod + key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/go.sum') }} + + - name: Test + run: go test -v -short ./... + env: + GOARCH: ${{ matrix.arch }}