-
Notifications
You must be signed in to change notification settings - Fork 19
80 lines (68 loc) · 1.93 KB
/
backend-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
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
name: Backend Tests
on:
pull_request:
paths:
- # Scripts, GitHub actions that contain 'backend' in their path.
'**/*backend*'
- # The backend source code
'src/backend/**'
- 'src/shared/**'
- # Rust files such as Cargo.lock, Cargo.toml and rust-toolchain.toml
'**/Cargo*'
- '**/*rust*'
- # The dockerfile used in this CI run, and the scripts it COPY's.
'Dockerfile'
- 'docker/**'
- # There may be some files in frontend folder that contains 'backend' in their name.
'!src/frontend/**'
workflow_dispatch:
jobs:
docker-build-base:
runs-on: ubuntu-24.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build Base Docker Image
uses: ./.github/actions/docker-build-base
docker-build:
runs-on: ubuntu-24.04
needs: docker-build-base
strategy:
matrix:
include:
- name: backend.wasm.gz
target: scratch_backend
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build canister WASM
uses: ./.github/actions/docker-build-backend
with:
name: ${{ matrix.name }}
target: ${{ matrix.target }}
tests:
runs-on: ubuntu-24.04
needs: [ 'docker-build' ]
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-backend-tests-${{ hashFiles('Cargo.lock', 'rust-toolchain.toml') }}
- name: Download backend.wasm.gz
uses: actions/download-artifact@v4
with:
name: backend.wasm.gz
path: .
- name: "Run backend tests"
working-directory: .
run: ./scripts/test.backend.sh
may-merge:
needs: [ 'tests' ]
runs-on: ubuntu-24.04
steps:
- name: Cleared for merging
run: echo OK