-
Notifications
You must be signed in to change notification settings - Fork 1
84 lines (69 loc) · 1.84 KB
/
tests.yml
File metadata and controls
84 lines (69 loc) · 1.84 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
83
84
---
name: tests
on:
pull_request:
push:
branches:
- main
env:
VCC_USER: ${{ secrets.VCC_USER }}
VCC_PASS: ${{ secrets.VCC_PASS }}
GOPROXY: direct
jobs:
# Breaking tests into 2 phases, to prevent account lock out due to DOS protection
tests-1:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.4
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Golang Tests
run: go test -v ./...
- name: Setup BATS
if: runner.os != 'windows'
run: |
set -e
if [ -n "$GITHUB_RUN_ID" ]; then
export GITHUB_API_TOKEN="${{ secrets.GITHUB_TOKEN }}"
fi
git clone https://github.com/bats-core/bats-core.git && bats-core/install.sh $HOME
- name: Run BATS Tests
if: runner.os != 'windows'
run: |
export PATH=${PATH}:/home/runner/bin
# Retry hack to attempt test 3 times
bats test/bats
tests-2:
strategy:
matrix:
os: [macos-14, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version: 1.21.4
- name: Checkout Code
uses: actions/checkout@v4
- name: Run Golang Tests
run: go test -v ./...
- name: Setup BATS
if: runner.os != 'windows'
run: |
set -e
if [ -n "$GITHUB_RUN_ID" ]; then
export GITHUB_API_TOKEN="${{ secrets.GITHUB_TOKEN }}"
fi
git clone https://github.com/bats-core/bats-core.git && bats-core/install.sh $HOME
- name: Run BATS Tests
if: runner.os != 'windows'
run: |
export PATH=${PATH}:/home/runner/bin
# Retry hack to attempt test 3 times
bats test/bats