-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (73 loc) · 1.92 KB
/
build_and_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
name: Run Tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:
inputs:
use_cache:
description: 'Use cache for build'
required: true
default: 'true'
type: 'choice'
options:
- 'true'
- 'false'
env:
USE_CACHE: ${{ github.event.inputs.use_cache || 'true' }}
CACHE_VERSION: v01
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-24.04, macos-15]
fail-fast: false
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: "Restore cache dependencies"
id: cache-restore
if: ${{ env.USE_CACHE == 'true' }}
uses: actions/cache/restore@v4
with:
path: |
~/.cargo
~/.hunter
~/.cache/pip
~/.cache/vcpkg
.vcpkg
.venv
.build
key: jam-${{ runner.os }}-${{ github.job }}-${{ env.CACHE_VERSION }}
restore-keys: |
jam-${{ runner.os }}-${{ github.job }}
jam-${{ runner.os }}
- name: "Basic init"
run: |
if [[ $RUNNER_OS == "Linux" ]]; then
sudo ./.ci/scripts/init.sh
else
./.ci/scripts/init.sh
fi
- name: "Init all dependencies"
run: |
make init_py
make init_vcpkg
- name: "Configure"
run: make configure
- name: "Build"
run: make build
- name: "Test"
run: make test
- name: "Always Save Cache"
id: cache-save
if: always() && ( steps.cache-restore.outputs.cache-hit != 'true' )
uses: actions/cache/save@v4
with:
path: ${{ env.CACHE_PATH }}
key: ${{ steps.cache-restore.outputs.cache-primary-key }}