-
Notifications
You must be signed in to change notification settings - Fork 110
68 lines (61 loc) · 2.05 KB
/
tests.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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
on:
workflow_call:
name: Tests
jobs:
get-go-versions:
name: Collect available Go versions
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.versions.outputs.matrix }}
steps:
- uses: actions/checkout@v3
- uses: arnested/go-version-action@d44f8fbecf1ac5ea61d81603e99dfec9833f592f
id: versions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
runs-on: ${{ matrix.os }}
needs: get-go-versions
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Setup - Go ${{ matrix.go-version }}
uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab
with:
go-version: ${{ matrix.go-version }}
- name: Setup - Python
uses: actions/setup-python@7f80679172b057fc5e90d70d197929d454754a5a
with:
python-version: 3.6
cache: "pip"
cache-dependency-path: "requirements-test.txt"
- name: Install Python dependencies
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade -r requirements-test.txt
- name: Run tests
run: go test -race -covermode atomic -coverprofile='profile.cov' ./...
- name: Send coverage
uses: shogo82148/actions-goveralls@31ee804b8576ae49f6dc3caa22591bc5080e7920
with:
path-to-profile: profile.cov
flag-name: Go-${{ matrix.go-version }}
parallel: true
golangci:
strategy:
matrix:
go-version: ${{ fromJSON(needs.get-go-versions.outputs.matrix) }}
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
needs: get-go-versions
steps:
- uses: actions/setup-go@f6164bd8c8acb4a71fb2791a8b6c4024ff038dab
- uses: actions/checkout@v3
- name: golangci-lint
uses: golangci/golangci-lint-action@5c56cd6c9dc07901af25baab6f2b0d9f3b7c3018
with:
version: v1.45.2