-
Notifications
You must be signed in to change notification settings - Fork 32
56 lines (48 loc) · 1.43 KB
/
backend.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
# Based on https://github.com/actions-rs/meta/blob/master/recipes/quickstart.md
on:
pull_request:
paths:
- 'actix-api/**'
- 'types/**'
- 'yew-ui/**'
- 'docker/**'
name: check backend
jobs:
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Cache Docker layers
- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.docker
key: ${{ runner.os }}-docker-${{ github.sha }}
restore-keys: |
${{ runner.os }}-docker-
# Cache Rust build artifacts
- name: Cache Cargo Registry
uses: actions/cache@v2
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
# Load cached Docker images
- name: Load cached Docker images
run: |
mkdir -p /tmp/.docker
if [ -d "/tmp/.docker" ]; then
docker load < /tmp/.docker/images.tar || true
fi
- run: make check
- run: make test
# Save Docker images after tests
- name: Save Docker images
run: |
mkdir -p /tmp/.docker
docker save -o /tmp/.docker/images.tar $(docker-compose -f docker/docker-compose.yaml config --services | awk '{print $1}')