-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (99 loc) · 3.4 KB
/
CaffaUnitTests.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
name: Build with Unit Tests
on:
push:
pull_request:
branches:
- main
workflow_dispatch:
schedule:
- cron: '0 1 * * *'
jobs:
caffa:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ windows-latest, ubuntu-22.04, ubuntu-24.04, macos-13, macos-14 ]
include:
- os: windows-latest
triplet: x64-windows
vcpkgCommitId: 'eb0f108ebd674c6ed79acb1c2e123208c416af0d'
- os: ubuntu-22.04
vcpkgCommitId: 'eb0f108ebd674c6ed79acb1c2e123208c416af0d'
- os: ubuntu-24.04
vcpkgCommitId: 'eb0f108ebd674c6ed79acb1c2e123208c416af0d'
- os: macos-13
vcpkgCommitId: 'eb0f108ebd674c6ed79acb1c2e123208c416af0d'
- os: macos-14
vcpkgCommitId: 'eb0f108ebd674c6ed79acb1c2e123208c416af0d'
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
steps:
- name: Install dependencies
run: sudo apt-get install ninja-build googletest libgtest-dev libssl-dev
if: contains(matrix.os, 'ubuntu')
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- uses: lukka/get-cmake@latest
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
if: contains(matrix.os, 'windows')
- name: List $RUNNER_WORKSPACE before build
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup VCPKG or load from cache
uses: lukka/run-vcpkg@v11
id: runvcpkg
with:
vcpkgDirectory: '${{ runner.workspace }}/b/vcpkg'
vcpkgGitCommitId: '${{ matrix.vcpkgCommitId}}'
runVcpkgInstall: true
vcpkgJsonGlob: '*/vcpkg.json'
- name: Prints output of run-vcpkg's action.
run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' "
- name: Configure Caffa
uses: lukka/run-cmake@v10.7
with:
configurePreset: 'ninja-multi-vcpkg'
- name: Build Caffa
uses: lukka/run-cmake@v10.7
with:
buildPreset: 'ninja-release-vcpkg'
- name: Run Caffa Unit Tests
uses: lukka/run-cmake@v10.7
with:
testPreset: 'test-release-vcpkg'
- name: List $RUNNER_WORKSPACE after build
run: find $RUNNER_WORKSPACE
shell: bash
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Install Python modules
run: |
python -m pip install --upgrade pip
pip install setuptools pytest requests
- name: Run pytest
run: |
builds/ninja-multi-vcpkg/bin/Release/caffaRestInterface_ExampleServer 50000 1 &
cd RestInterface/Bindings/Python/caffa
python -m pytest --log-cli-level=DEBUG
cd ../../..
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'adopt'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@v3
- name: Build with Gradle
run: |
builds/ninja-multi-vcpkg/bin/Release/caffaRestInterface_ExampleServer 50000 1 &
cd RestInterface/Bindings/Java
gradle wrapper
./gradlew build