-
Notifications
You must be signed in to change notification settings - Fork 143
133 lines (118 loc) · 3.73 KB
/
e2e-test2.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
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
name: "E2e test"
on:
pull_request:
branches: [main]
jobs:
build:
name: parallel buck2 builds
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
target:
- //core/api
- //core/api-ws-server
- //core/api-trigger
- //core/api-exporter
- //apps/dashboard
- //apps/consent
- //apps/pay
- //apps/admin-panel
- //apps/map
- //apps/voucher
- //core/api-keys
- //core/notifications
- //bats/helpers/callback:run
- //bats/helpers/subscriber:run
- //bats/helpers/totp:generate
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- name: Build
run: |
nix develop -c buck2 build ${{ matrix.target }}
- uses: actions/cache/save@v4
with:
path: |
~/.buck2
buck-out
.buck-cache
prebuilt
installed
target
.buckd
buck-out/cache
key: b2-${{ matrix.target }}-${{ github.sha:(-4) }}
enableCrossOsArchive: true
tests:
name: execute via bats
runs-on: ubuntu-latest
timeout-minutes: 25
needs: build
steps:
- uses: actions/checkout@v4
- name: Install Nix
uses: DeterminateSystems/nix-installer-action@v14
- name: Run the Magic Nix Cache
uses: DeterminateSystems/magic-nix-cache-action@v8
- uses: actions/cache/restore@v4
with:
path: |
~/.buck2
buck-out
.buck-cache
prebuilt
installed
target
.buckd
buck-out/cache
key: |
b2-//core/api-${{ github.sha:(-4) }}
b2-//core/api-ws-server-${{ github.sha:(-4) }}
b2-//core/api-trigger-${{ github.sha:(-4) }}
b2-//core/api-exporter-${{ github.sha:(-4) }}
b2-//apps/dashboard-${{ github.sha:(-4) }}
b2-//apps/consent-${{ github.sha:(-4) }}
b2-//apps/pay-${{ github.sha:(-4) }}
b2-//apps/admin-panel-${{ github.sha:(-4) }}
b2-//apps/map-${{ github.sha:(-4) }}
b2-//apps/voucher-${{ github.sha:(-4) }}
b2-//core/api-keys-${{ github.sha:(-4) }}
b2-//core/notifications-${{ github.sha:(-4) }}
b2-//bats/helpers/callback:run-${{ github.sha:(-4) }}
b2-//bats/helpers/subscriber:run-${{ github.sha:(-4) }}
b2-//bats/helpers/totp:generate-${{ github.sha:(-4) }}
restore-keys: |
buck2-${{ runner.os }}-
fail-on-cache-miss: true
- name: Run bats tests
run: |
nix develop -c buck2 build //core/api \
//core/api-ws-server \
//core/api-trigger \
//core/api-exporter \
//apps/dashboard \
//apps/consent \
//apps/pay \
//apps/admin-panel \
//apps/map \
//apps/voucher \
//core/api-keys \
//core/notifications \
//bats/helpers/callback:run \
//bats/helpers/subscriber:run \
//bats/helpers/totp:generate
nix develop -c bats --setup-suite-file bats/ci_setup_suite.bash -t bats/core/**
- name: Rename Tilt log
if: always()
run: mv bats/.e2e-tilt.log bats/e2e-tilt.log
- name: Upload Tilt log
if: always()
uses: actions/upload-artifact@v4
with:
name: Tilt log
path: bats/e2e-tilt.log