-
Notifications
You must be signed in to change notification settings - Fork 3
91 lines (78 loc) · 2.43 KB
/
pr-tests.yml
File metadata and controls
91 lines (78 loc) · 2.43 KB
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
name: PR CI — run tests
on:
pull_request:
branches:
- master
jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
preset: linux-prod
- os: windows-latest
preset: windows-prod
- os: macos-latest
preset: macos-prod
timeout-minutes: 60
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Setup pnpm
uses: pnpm/action-setup@v2
with:
version: 10
- name: Cache pnpm store
uses: actions/cache@v4
with:
path: |
~/.local/share/pnpm/store
~/Library/pnpm/store
~/AppData/Local/pnpm/store
key: pnpm-${{ runner.os }}-${{ hashFiles('app/pnpm-lock.yaml') }}
restore-keys: |
pnpm-${{ runner.os }}-
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
ninja-build \
build-essential \
pkg-config \
ca-certificates
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja
- name: Setup vcpkg
uses: lukka/run-vcpkg@v11
with:
vcpkgDirectory: '${{ github.workspace }}/vcpkg'
vcpkgGitCommitId: 'bb1ad44ed8d7cfb77d180cdc1585f8b87c2c7428'
vcpkgJsonGlob: 'engine/vcpkg.json'
- name: Build and test engine
uses: lukka/run-cmake@v10
with:
cmakeListsTxtPath: '${{ github.workspace }}/engine/CMakeLists.txt'
configurePreset: ${{ matrix.preset }}
buildPreset: ${{ matrix.preset }}
configurePresetAdditionalArgs: "['-DVAYU_BUILD_TESTS=ON']"
- name: Run engine tests
working-directory: engine
run: ctest --preset ${{ matrix.preset }} --output-on-failure
- name: Install frontend dependencies
working-directory: app
run: pnpm install --frozen-lockfile
- name: Run frontend tests
working-directory: app
run: pnpm test --if-present