|
5 | 5 | branches: [ main ] |
6 | 6 | pull_request: |
7 | 7 | branches: [ main ] |
8 | | - workflow_dispatch: |
9 | 8 |
|
10 | 9 | jobs: |
11 | 10 | test: |
12 | 11 | runs-on: ubuntu-latest |
13 | | - |
14 | 12 | steps: |
15 | | - - name: Checkout code |
16 | | - uses: actions/checkout@v4 |
| 13 | + - name: Checkout code |
| 14 | + uses: actions/checkout@v4 |
17 | 15 |
|
18 | | - - name: Set up Go |
19 | | - uses: actions/setup-go@v4 |
20 | | - with: |
21 | | - go-version: '1.24.3' |
| 16 | + - name: Set up Go |
| 17 | + uses: actions/setup-go@v4 |
| 18 | + with: |
| 19 | + go-version: '1.24.3' |
22 | 20 |
|
23 | | - - name: Cache Go modules |
24 | | - uses: actions/cache@v3 |
25 | | - with: |
26 | | - path: ~/go/pkg/mod |
27 | | - key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }} |
28 | | - restore-keys: | |
29 | | - ${{ runner.os }}-go- |
| 21 | + - name: Cache Go modules |
| 22 | + uses: actions/cache@v3 |
| 23 | + with: |
| 24 | + path: ~/go/pkg/mod |
| 25 | + key: ${{ runner.os }}-go-${{ hashFiles('services/bounty-service/go.sum') }} |
| 26 | + restore-keys: | |
| 27 | + ${{ runner.os }}-go- |
30 | 28 |
|
31 | | - - name: Download dependencies |
32 | | - run: | |
33 | | - cd services/bounty-service |
34 | | - go mod download |
| 29 | + - name: Download dependencies |
| 30 | + working-directory: services/bounty-service |
| 31 | + run: go mod download |
35 | 32 |
|
36 | | - - name: Run tests |
37 | | - run: | |
38 | | - cd services/bounty-service |
39 | | - go test -v ./... |
| 33 | + - name: Run tests |
| 34 | + working-directory: services/bounty-service |
| 35 | + run: go test -v ./... |
40 | 36 |
|
41 | | - - name: Run tests with coverage |
42 | | - run: | |
43 | | - cd services/bounty-service |
44 | | - go test -v -coverprofile=coverage.out ./... |
45 | | - mv coverage.out ${{ github.workspace }}/coverage.out |
| 37 | + - name: Run tests with coverage |
| 38 | + working-directory: services/bounty-service |
| 39 | + run: | |
| 40 | + go test -v -coverprofile=coverage.out ./... |
| 41 | + mv coverage.out ${{ github.workspace }}/coverage.out |
46 | 42 |
|
47 | | - - name: Upload coverage to Codecov |
48 | | - uses: codecov/codecov-action@v3 |
49 | | - with: |
50 | | - file: ./coverage.out |
51 | | - flags: unittests |
52 | | - name: codecov-umbrella |
| 43 | + - name: Upload coverage to Codecov |
| 44 | + uses: codecov/codecov-action@v3 |
| 45 | + with: |
| 46 | + file: ./coverage.out |
| 47 | + flags: unittests |
| 48 | + name: codecov-umbrella |
53 | 49 |
|
54 | 50 | lint: |
55 | 51 | runs-on: ubuntu-latest |
|
66 | 62 | uses: golangci/golangci-lint-action@v3 |
67 | 63 | with: |
68 | 64 | version: latest |
69 | | - args: --timeout=5m --path-prefix=services/bounty-service |
| 65 | + working-directory: services/bounty-service |
| 66 | + args: --timeout=5m --out-format=colored-line-number |
0 commit comments