| 1 |
name: ci |
| 2 |
permissions: |
| 3 |
contents: read |
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: |
| 7 |
- master |
| 8 |
pull_request: |
| 9 |
schedule: |
| 10 |
- cron: "17 12 * * 6" |
| 11 |
jobs: |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
required: |
| 16 |
needs: |
| 17 |
- test |
| 18 |
- coverage |
| 19 |
- lint |
| 20 |
runs-on: ubuntu-latest |
| 21 |
steps: |
| 22 |
- run: "true" |
| 23 |
test: |
| 24 |
strategy: |
| 25 |
matrix: |
| 26 |
go-version: [1.20.x, 1.21.x] |
| 27 |
runs-on: ubuntu-latest |
| 28 |
steps: |
| 29 |
- name: Install Go |
| 30 |
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f |
| 31 |
with: |
| 32 |
go-version: ${{ matrix.go-version }} |
| 33 |
check-latest: true |
| 34 |
- name: Checkout code |
| 35 |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 |
| 36 |
with: |
| 37 |
persist-credentials: false |
| 38 |
- name: Bootstrap |
| 39 |
run: ./script/bootstrap |
| 40 |
- name: Build |
| 41 |
run: go build ./... |
| 42 |
- name: Test |
| 43 |
run: go test -bench . ./... |
| 44 |
coverage: |
| 45 |
needs: |
| 46 |
- test |
| 47 |
runs-on: ubuntu-latest |
| 48 |
steps: |
| 49 |
- name: Install Go |
| 50 |
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f |
| 51 |
with: |
| 52 |
go-version: 1.21.x |
| 53 |
check-latest: true |
| 54 |
- name: Checkout code |
| 55 |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 |
| 56 |
with: |
| 57 |
persist-credentials: false |
| 58 |
- name: Bootstrap |
| 59 |
run: ./script/bootstrap |
| 60 |
- name: Coverage |
| 61 |
run: ./script/coverage |
| 62 |
- name: Upload Unit Test Coverage |
| 63 |
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 |
| 64 |
with: |
| 65 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 66 |
files: unittests.coverprofile |
| 67 |
flags: unittests |
| 68 |
- name: Upload Integration Test Coverage |
| 69 |
uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 |
| 70 |
with: |
| 71 |
token: ${{ secrets.CODECOV_TOKEN }} |
| 72 |
files: integration.coverprofile |
| 73 |
flags: integration |
| 74 |
lint: |
| 75 |
runs-on: ubuntu-latest |
| 76 |
steps: |
| 77 |
- name: Install Go |
| 78 |
uses: actions/setup-go@c4a742cab115ed795e34d4513e2cf7d472deb55f |
| 79 |
with: |
| 80 |
go-version: 1.21.x |
| 81 |
check-latest: true |
| 82 |
- name: Checkout code |
| 83 |
uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 |
| 84 |
with: |
| 85 |
persist-credentials: false |
| 86 |
- name: Bootstrap |
| 87 |
run: ./script/bootstrap |
| 88 |
- name: Lint |
| 89 |
run: ./script/lint |