flamingo.me/flamingo-commerce/v3@v3.11.0/.github/workflows/main.yml (about) 1 name: Tests 2 3 on: 4 push: 5 branches: 6 - master 7 pull_request: 8 branches: 9 - master 10 11 jobs: 12 run-tests: 13 runs-on: ubuntu-latest 14 strategy: 15 matrix: 16 go: [ '1.21', '1.x' ] 17 name: With Go ${{ matrix.go }} 18 steps: 19 - uses: actions/checkout@v4 20 - name: Setup Go 21 uses: actions/setup-go@v5 22 with: 23 go-version: ${{ matrix.go }} 24 check-latest: true 25 - name: Get dependencies 26 run: go get -v -t -d ./... 27 - name: Test 28 run: go test -race ./... 29 generate-checks: 30 runs-on: ubuntu-latest 31 name: Generate check 32 steps: 33 - uses: actions/checkout@v4 34 - name: Setup Go 35 uses: actions/setup-go@v5 36 with: 37 go-version: '1.21' # generation issue in go 1.22 with mockery https://github.com/vektra/mockery/issues/752 38 check-latest: true 39 - name: Goimports 40 run: | 41 go run golang.org/x/tools/cmd/goimports@latest -w . 42 git diff --quiet || (echo 'goimports requires code cleanup:' ; git diff ; exit 1) 43 - name: Go Generate 44 run: | 45 go generate ./... 46 # Bug in swag results in Flaky swagger docs - see https://github.com/swaggo/swag/issues/721 47 # git diff --quiet || (echo 'generated go files are not up to date, check go generate, go.sum and go.mod' ; git diff ; exit 1) 48 git diff --quiet -- . ":(exclude)docs" || (echo 'generated go files are not up to date, check go generate, go.sum and go.mod' ; git diff -- . ":(exclude)docs"; exit 1) 49 integration-tests: 50 runs-on: ubuntu-latest 51 name: Integration 52 steps: 53 - uses: actions/checkout@v4 54 - name: Setup Go 55 uses: actions/setup-go@v5 56 with: 57 go-version: '1.x' 58 check-latest: true 59 - name: Generate GraphQL 60 run: | 61 cd test/integrationtest/projecttest && go run -tags graphql main.go && cd ../../../ 62 git diff --quiet || (echo 'generated go files for graphql are not up to date, check go generate' ; git diff ; exit 1) 63 - name: Test 64 run: go test -test.count=10 -race -v ./test/integrationtest/... -tags=integration