-
Notifications
You must be signed in to change notification settings - Fork 7
36 lines (36 loc) · 1.1 KB
/
test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
on:
push:
branches:
- main
pull_request:
name: Tests
jobs:
test:
strategy:
matrix:
go:
- version: "1.22"
report: true
- version: "1.21"
runs-on: ubuntu-latest
steps:
- name: Install code climate
if: matrix.go.report == true && github.ref == 'refs/heads/main'
run: |
wget -O /tmp/cc-test-reporter https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
chmod +x /tmp/cc-test-reporter
/tmp/cc-test-reporter before-build
- name: Checkout code
uses: actions/checkout@v4
- name: Run tests
env:
GO_VERSION: ${{ matrix.go.version }}
run: |
docker compose run test
echo $? > /tmp/GO_EXIT_CODE
- name: Send results to code climate
if: matrix.go.report == true && github.ref == 'refs/heads/main'
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}
run: |
/tmp/cc-test-reporter after-build --prefix github.com/$GITHUB_REPOSITORY --exit-code `cat /tmp/GO_EXIT_CODE`