-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (40 loc) · 1005 Bytes
/
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
---
name: tests
on:
pull_request:
push:
branches:
- main
env:
VCC_USER: ${{ secrets.VCC_USER }}
VCC_PASS: ${{ secrets.VCC_PASS }}
GOPROXY: direct
jobs:
tests:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, 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@v3
- 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