File: tests-template.yaml

package info (click to toggle)
etcd 3.5.16-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,892 kB
  • sloc: sh: 3,139; makefile: 478
file content (76 lines) | stat: -rw-r--r-- 2,701 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
---
name: Reusable Tests Workflow
on:
  workflow_call:
    inputs:
      arch:
        required: true
        type: string
      runs-on:
        required: true
        type: string
      targets:
        required: false
        type: string

jobs:
  test:
    runs-on: ${{ inputs.runs-on }}
    # this is to prevent arm64 jobs from running at forked projects
    if: inputs.arch == 'amd64' || github.repository == 'etcd-io/etcd'
    strategy:
      fail-fast: false
      matrix:
        target: ${{ fromJSON(inputs.targets) }}
    steps:
      - uses: actions/checkout@v2
      - id: goversion
        run: echo "goversion=$(cat .go-version)" >> "$GITHUB_OUTPUT"
      - uses: actions/setup-go@v2
        with:
          go-version: ${{ steps.goversion.outputs.goversion }}
      - run: date
      - env:
          TARGET: ${{ matrix.target }}
        run: |
          set -euo pipefail

          echo "${TARGET}"
          case "${TARGET}" in
            linux-test-smoke)
              GOARCH=${{ inputs.arch }} CPU=4 RACE='false' make test-smoke
              ;;
            linux-integration-1-cpu)
              make install-gofail
              GOARCH=${{ inputs.arch }} CPU=1 RACE='false' FAILPOINTS='true' make test-integration
              ;;
            linux-integration-2-cpu)
              make install-gofail
              GOARCH=${{ inputs.arch }} CPU=2 RACE='false' FAILPOINTS='true' make test-integration
              ;;
            linux-integration-4-cpu)
              make install-gofail
              GOARCH=${{ inputs.arch }} CPU=4 RACE='false' FAILPOINTS='true' make test-integration
              ;;
            linux-unit-4-cpu-race)
              GOARCH=${{ inputs.arch }} RACE='true' CPU='4' GO_TEST_FLAGS='-p=2' make test-unit
              ;;
            linux-386-unit-1-cpu)
              GOOS=linux GOARCH=386 CPU=1 GO_TEST_FLAGS='-p=4' make test-unit
              ;;
            all-build)
              GOARCH=amd64 PASSES='build' ./test.sh
              GOARCH=386 PASSES='build' ./test.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=amd64 ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOOS=darwin GOARCH=arm64 ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOOS=windows GOARCH=amd64 ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=arm64 ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=ppc64le ./build.sh
              GO_BUILD_FLAGS='-v -mod=readonly' GOARCH=s390x ./build.sh
              ;;
            *)
              echo "Failed to find target"
              exit 1
              ;;
          esac