-
Notifications
You must be signed in to change notification settings - Fork 15
67 lines (64 loc) · 1.87 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
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
on:
push:
branches:
- master
pull_request:
branches:
- master
name: run tests
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Install Go
uses: actions/setup-go@v5
with:
go-version: stable
- name: Checkout code
uses: actions/checkout@v4
- name: Run linters
uses: golangci/golangci-lint-action@v6
- name: Check code formatting using gofmt
uses: Jerome1337/[email protected]
test:
strategy:
matrix:
go: [stable, oldstable]
platform: [ubuntu-latest , macos-latest, windows-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go }}
- uses: actions/checkout@v4
- name: Install Dependencies (Linux)
run: |
sudo apt-get update
sudo apt-get install -y gnome-keyring build-essential ca-certificates
mkdir -p $HOME/.cache/
mkdir -p $HOME/.local/share/keyrings/
chmod 700 -R $HOME/.local/
if: matrix.platform == 'ubuntu-latest'
- name: tests (other)
run: go test -v -coverprofile=profile ./...
if: matrix.platform != 'ubuntu-latest'
- name: tests (Linux)
run: |
echo 'somecredstorepass' | gnome-keyring-daemon --unlock
go test -v -coverprofile=profile ./...
shell: dbus-run-session -- bash --noprofile --norc -eo pipefail {0}
if: matrix.platform == 'ubuntu-latest'
- name: Send coverage
uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: profile
flag-name: Platform-${{ matrix.platform }}
parallel: true
# notifies that all test jobs are finished.
finish:
needs: test
runs-on: ubuntu-latest
steps:
- uses: shogo82148/actions-goveralls@v1
with:
parallel-finished: true