-
Notifications
You must be signed in to change notification settings - Fork 101
56 lines (54 loc) · 1.7 KB
/
test.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
name: Test
on:
push:
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
- name: Read Go version
id: go-version
run: echo "version=$(cat ./.go-version)" >> $GITHUB_OUTPUT
- name: Install Go
uses: actions/setup-go@4d34df0c2316fe8122ab82dc22947d607c0c91f9 # v4.0.0
with:
go-version: ${{ steps.go-version.outputs.version }}
- name: Run go vet
run: make vet
- name: Install vault, nomad, consul
env:
NOMAD_LICENSE: ${{ secrets.NOMAD_LICENSE }}
run: |
./scripts/getnomad.sh
./scripts/getvault.sh
./scripts/getconsul.sh
- name: Start nomad
env:
NOMAD_LICENSE: ${{ secrets.NOMAD_LICENSE }}
run: ./scripts/start-nomad.sh
- name: Run acceptance tests
run: NOMAD_TOKEN=${{ env.NOMAD_TOKEN }} make testacc
env:
NOMAD_TOKEN: 00000000-0000-0000-0000-000000000000
- name: Stop nomad
if: always()
run: ./scripts/stop-nomad.sh
- name: Make Nomad data dir and log file readable
if: always()
run: |
sudo chmod -R 777 /tmp/nomad
sudo chmod 666 /tmp/nomad.log
- name: Upload logs
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2
if: always()
with:
name: logs
path: |
/tmp/consul.log
/tmp/nomad.log
/tmp/vault.log
/tmp/nomad/data/**/alloc/logs/plugin*
!/tmp/nomad/data/**/alloc/logs/*.fifo
if-no-files-found: warn
retention-days: 3