|
| 1 | +name: Arcadia Continuous Integration |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + |
| 6 | +jobs: |
| 7 | + golangci: |
| 8 | + name: lint |
| 9 | + runs-on: ubuntu-latest |
| 10 | + steps: |
| 11 | + - uses: actions/setup-go@v5 |
| 12 | + with: |
| 13 | + go-version: 1.26 |
| 14 | + - uses: actions/checkout@v4 |
| 15 | + - name: golangci-lint |
| 16 | + uses: golangci/golangci-lint-action@v7 |
| 17 | + with: |
| 18 | + version: v2.10.1 |
| 19 | + args: --verbose |
| 20 | + |
| 21 | + test: |
| 22 | + strategy: |
| 23 | + matrix: |
| 24 | + go-version: [1.26] |
| 25 | + platform: [ubuntu-latest, macos-latest] |
| 26 | + |
| 27 | + runs-on: ${{ matrix.platform }} |
| 28 | + |
| 29 | + env: |
| 30 | + COVER_DIR: ${{ github.workspace }}/coverage |
| 31 | + COVER_FILE: coverage.out |
| 32 | + COVER_OUT_PATH: ${{ github.workspace }}/coverage/coverage.out |
| 33 | + COVER_HTML_PATH: ${{ github.workspace }}/coverage/coverage.html |
| 34 | + GINKGO_REPORT: ginkgo.report |
| 35 | + |
| 36 | + steps: |
| 37 | + - name: Install Go |
| 38 | + uses: actions/setup-go@v5 |
| 39 | + with: |
| 40 | + go-version: ${{ matrix.go-version }} |
| 41 | + |
| 42 | + - name: Install goveralls |
| 43 | + run: go install github.com/mattn/goveralls@latest |
| 44 | + |
| 45 | + - name: Install ginkgo |
| 46 | + run: go install github.com/onsi/ginkgo/v2/ginkgo@v2.20.0 |
| 47 | + |
| 48 | + - name: Checkout code |
| 49 | + uses: actions/checkout@v4 |
| 50 | + |
| 51 | + - name: Ensure coverage directory exists |
| 52 | + run: | |
| 53 | + mkdir -p ${{ github.workspace }}/coverage |
| 54 | + |
| 55 | + - name: Run tests and generate coverage profile with Ginkgo |
| 56 | + run: | |
| 57 | + ginkgo run -r -json-report {{env.GINKGO_REPORT}} -coverpkg=./... -coverprofile=coverage.out |
| 58 | +
|
| 59 | + - name: Apply coverage exclusions |
| 60 | + run: | |
| 61 | + ${{ github.workspace }}/scripts/apply-coverage-exclusions.sh |
| 62 | + |
| 63 | + - name: Check coverage directory contents |
| 64 | + run: | |
| 65 | + echo "Contents of ${{ github.workspace }}/coverage:" |
| 66 | + ls -la ${{ github.workspace }}/coverage |
| 67 | +
|
| 68 | + - name: Generate HTML coverage report |
| 69 | + run: | |
| 70 | + go tool cover -html=coverage.out -o ${{ github.workspace }}/coverage/coverage.html |
| 71 | +
|
| 72 | + - name: Upload coverage to Coveralls |
| 73 | + uses: shogo82148/actions-goveralls@v1 |
| 74 | + with: |
| 75 | + path-to-profile: coverage.out |
0 commit comments