github.com/emmansun/gmsm@v0.29.1/.github/workflows/ci.yml (about) 1 name: ci 2 3 on: 4 push: 5 branches: [ main ] 6 pull_request: 7 branches: [ main ] 8 9 jobs: 10 11 build: 12 runs-on: ubuntu-latest 13 strategy: 14 matrix: 15 goVer: ['1.18', '1.19', '1.21', '1.22'] 16 steps: 17 - name: Checkout Repo 18 uses: actions/checkout@v4 19 20 - name: Set up Go 21 uses: actions/setup-go@v5 22 with: 23 go-version: ${{ matrix.goVer }} 24 25 - name: Test with Coverage 26 if: ${{ matrix.goVer == '1.18' }} 27 run: go test -coverpkg=./... -v -short -race -coverprofile=coverage1.txt -covermode=atomic ./... 28 env: 29 GODEBUG: x509sha1=1 30 31 - name: Test Generic with Coverage 32 if: ${{ matrix.goVer == '1.18' }} 33 run: go test -coverpkg=./... -v -short -tags purego -coverprofile=coverage2.txt -covermode=atomic ./... 34 env: 35 GODEBUG: x509sha1=1 36 37 - name: Upload coverage to Codecov 38 if: ${{ matrix.goVer == '1.18' }} 39 uses: codecov/codecov-action@v4 40 with: 41 files: ./coverage1.txt,./coverage2.txt 42 env: 43 CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} 44 45 - name: Test Force SM4 Single Block with AES-NI 46 run: go test -short ./sm4/... 47 env: 48 FORCE_SM4BLOCK_AESNI: 1 49 50 - name: Test only 51 if: ${{ matrix.goVer != '1.18' }} 52 run: go test -short ./... 53 env: 54 GODEBUG: x509sha1=1 55 56 - name: Test Generic only 57 if: ${{ matrix.goVer != '1.18' }} 58 run: go test -short -tags purego ./... 59 env: 60 GODEBUG: x509sha1=1 61 62 - name: Test Plugin only 63 if: ${{ matrix.goVer != '1.18' }} 64 run: go test -short -tags plugin ./... 65 env: 66 GODEBUG: x509sha1=1