141 lines (119 loc) · 3.98 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
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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
name: Test
permissions:
contents: read
on:
push:
branches:
- main
pull_request:
jobs:
integration:
strategy:
fail-fast: false
matrix:
go-version: [1.20.x]
node-version: [16.x]
platform: [ubuntu-latest]
deployment: [multi, single]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
cache: false
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: ui/yarn.lock
- name: set env vars
run: echo "$(go env GOPATH)/bin" >> $GITHUB_PATH
- name: build dev docker image
run: |
./scripts/build-dev-docker.bash
- name: start cluster
run: |
export POMERIUM_TAG=dev
cd ./integration/clusters/${{matrix.deployment}}
docker-compose up -d
- name: integration tests
run: |
(cd ./integration/clusters/${{matrix.deployment}} && docker-compose logs -f &)
go test -v ./integration/...
build:
strategy:
matrix:
go-version: [1.20.x]
node-version: [16.x]
platform: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: ${{ matrix.go-version }}
- uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c
with:
node-version: ${{ matrix.node-version }}
cache: yarn
cache-dependency-path: ui/yarn.lock
- name: build
run: |
make build-deps
make build
- name: save binary
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce
with:
path: bin/pomerium*
name: pomerium ${{ github.run_id }} ${{ matrix.platform }}
retention-days: 1
- name: test
run: make cover
- uses: jandelgado/gcov2lcov-action@c680c0f7c7442485f1749eb2a13e54a686e76eb5
if: matrix.platform == 'ubuntu-latest'
name: convert coverage to lcov
with:
infile: coverage.txt
outfile: coverage.lcov
- name: upload to coveralls
uses: coverallsapp/github-action@c7885c00cb7ec0b8f9f5ff3f53cddb980f7a4412
if: matrix.platform == 'ubuntu-latest'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: coverage.lcov
build-docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@4c0219f9ac95b02789c1075625400b2acbff50b1
- name: Docker Build
uses: docker/build-push-action@2eb1c1961a95fc15694676618e422e8ba1d63825
with:
context: .
file: ./Dockerfile
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
precommit:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9
with:
fetch-depth: 0
- uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753
with:
go-version: 1.20.x
cache: false
- uses: actions/setup-python@bd6b4b6205c4dbad673328db7b31b7fab9e241c0
with:
python-version: "3.x"
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
with:
extra_args: --show-diff-on-failure --from-ref ${{
github.event.pull_request.base.sha }} --to-ref ${{
github.event.pull_request.head.sha }}
env:
SKIP: lint