diff --git a/.github/workflows/test_amd64.yaml b/.github/workflows/test_amd64.yaml new file mode 100644 index 00000000..c6476a68 --- /dev/null +++ b/.github/workflows/test_amd64.yaml @@ -0,0 +1,26 @@ +name: Test AMD64 +permissions: read-all +on: [push, pull_request] +jobs: + test-linux-amd64: + uses: ./.github/workflows/test_template.yaml + with: + targets: "['linux-amd64-unit-4-cpu-race']" + test-linux-386: + uses: ./.github/workflows/test_template.yaml + with: + targets: "['linux-386-unit-1-cpu']" + + coverage: + needs: + - test-linux-amd64 + - test-linux-386 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - id: goversion + run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT" + - uses: actions/setup-go@v5 + with: + go-version: "1.21.6" + - run: make test \ No newline at end of file diff --git a/.github/workflows/test_arm64.yaml b/.github/workflows/test_arm64.yaml new file mode 100644 index 00000000..e9db4240 --- /dev/null +++ b/.github/workflows/test_arm64.yaml @@ -0,0 +1,9 @@ +name: Test ARM64 +permissions: read-all +on: [push, pull_request] +jobs: + test-linux-arm64-cpu-race: + uses: ./.github/workflows/test_template.yaml + with: + runs-on: actuated-arm64-8cpu-8gb + targets: "['linux-arm64-unit-4-cpu-race']" diff --git a/.github/workflows/test.yaml b/.github/workflows/test_template.yaml similarity index 55% rename from .github/workflows/test.yaml rename to .github/workflows/test_template.yaml index 8d509ae8..9bce0b5d 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test_template.yaml @@ -1,22 +1,33 @@ -name: Test -on: [push, pull_request] +name: Workflow Test Template +on: + workflow_call: + inputs: + runs-on: + required: false + type: string + default: ubuntu-latest + targets: + required: false + type: string + default: "[]" +permissions: read-all + jobs: run: - runs-on: ubuntu-latest + runs-on: ${{ inputs.runs-on }} strategy: fail-fast: false matrix: - target: - - linux-amd64-unit-4-cpu-race - - linux-386-unit-1-cpu + target: ${{ fromJSON(inputs.targets) }} steps: - uses: actions/checkout@v4 - uses: actions/setup-go@v5 with: go-version: "1.21.6" - - env: + - env: TARGET: ${{ matrix.target }} run: | + go clean -testcache case "${TARGET}" in linux-amd64-unit-4-cpu-race) GOARCH=amd64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2 @@ -24,6 +35,9 @@ jobs: linux-386-unit-1-cpu) GOARCH=386 PASSES='unit' RACE='false' CPU='1' ./scripts/test.sh -p=4 ;; + linux-arm64-unit-4-cpu-race) + GOARCH=arm64 PASSES='unit' RACE='true' CPU='4' ./scripts/test.sh -p=2 + ;; *) echo "Failed to find target" exit 1