-
-
Notifications
You must be signed in to change notification settings - Fork 320
82 lines (66 loc) · 2.2 KB
/
Copy pathtest.yml
File metadata and controls
82 lines (66 loc) · 2.2 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
on:
pull_request:
name: Unit tests
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
- name: Install libusb
run: sudo apt-get update && sudo apt-get install -y libusb-1.0-0-dev
- name: Run go vet
run: go vet ./...
test_on_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
#- name: Install Libusb
# run: choco install
- name: Build executable
run: go build
#- name: Run unit tests
# run: go test -v ./...
test_on_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- name: Install Go
uses: actions/setup-go@v6
with:
go-version-file: go.mod
cache: true
- name: update
run: sudo apt-get update
- name: install libusb
run: sudo apt-get install -y libusb-1.0-0-dev
- name: Build executable
run: make build --trace
- name: Run unit tests
# -race so the data-race detector runs in CI (e.g. the TunnelManager
# mutex test). cgo is already on for libusb, so the detector is supported.
run: go test -race ./...
- name: Verify code formatting
run: test -z "$(gofmt -l .)"
# Run the real-device e2e suite only after all unit jobs pass, and only for
# same-repo PRs. Fork PRs can't access the device repo vars and must not run
# untrusted code on the self-hosted device runners — a maintainer triggers
# those with a "/test-devices" comment (see device-tests-comment.yml).
real-device:
name: Real device tests
needs: [lint, test_on_windows, test_on_linux]
if: github.event.pull_request.head.repo.full_name == github.repository
uses: ./.github/workflows/real-device.yml
# Pass repo secrets (App Store Connect signing keys etc.) into the reusable
# workflow so the opt-in signing e2e actually runs instead of skipping.
secrets: inherit
permissions:
contents: read