-
-
Notifications
You must be signed in to change notification settings - Fork 524
124 lines (121 loc) · 3.55 KB
/
unit_tests.yaml
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
name: "Build and Unit test"
on:
pull_request_target:
env:
HOMEBREW_NO_INSTALL_FROM_API:
jobs:
macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v4
with:
go-version: stable
- name: "Install dependencies"
env:
HOMEBREW_NO_INSTALL_FROM_API: ""
run: |
brew untap homebrew/core || true
brew untap homebrew/cask || true
brew update
brew install --cask macfuse
- name: Lint
run: make lint
- name: "Test arm64 build"
run: GOARCH=arm64 make build
- name: "Test amd64 build"
run: make build
- name: Run tests
uses: nick-fields/retry/@v2
with:
max_attempts: 3
timeout_minutes: 12
command: |
make check-unit
windows:
runs-on: windows-2019
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v4
with:
go-version: stable
- name: "Download winfsp"
shell: bash
run: |
curl -L -o winfsp.msi https://github.com/winfsp/winfsp/releases/download/v1.11/winfsp-1.11.22176.msi
- name: "Install winfsp"
shell: powershell
run: |
Start-Process msiexec -Wait -verb runAs -Args "/i winfsp.msi /passive /qn /L*V winfsp-install.log"
[Environment]::SetEnvironmentVariable("Path", "C:\\Program Files (x86)\\WinFsp\\inc\\fuse;$ENV:Path", "Machine")
- name: install make
run: choco install make
- name: Build
run: make build
- name: Lint
run: make lint
- name: Run tests
uses: nick-fields/retry/@v2
with:
max_attempts: 3
timeout_minutes: 12
command: |
$ENV:DTEST_KUBECONFIG = "${{ steps.kluster.outputs.kubeconfig }}"
$ENV:DTEST_REGISTRY = "docker.io/datawire"
make check-unit
linux-amd64:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v4
with:
go-version: stable
- run: |
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y socat make jq
- name: Lint
run: make lint
- name: "Test amd64 build"
run: make build
- name: Run tests
uses: nick-fields/retry/@v2
with:
max_attempts: 3
timeout_minutes: 10
command: |
make check-unit
linux-arm64:
runs-on: ubuntu-arm64
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: "${{ github.event.pull_request.head.sha }}"
- uses: actions/setup-go@v4
with:
go-version: stable
- run: |
sudo rm -f /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update
sudo apt-get install -y socat gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu make jq
- name: Lint
run: make lint
- name: "Test arm64 build"
run: GOARCH=arm64 CC=aarch64-linux-gnu-gcc make build
- name: Run tests
uses: nick-fields/retry/@v2
with:
max_attempts: 3
timeout_minutes: 10
command: |
make check-unit