1
+ # Copyright (c) 2021-2022-2023 Luca Cappa
2
+ # Released under the term specified in file LICENSE.txt
3
+ # SPDX short identifier: MIT
4
+ #
5
+ # The peculiarity of this workflow is that assumes vcpkg stored as a submodule of this repository.
6
+ # The workflow runs on x64 and ARM platforms.
7
+ # Workflow steps:
8
+ # - Setup vcpkg and cache it on the GitHub Action cloud based cache.
9
+ # - Runs CMake with CMakePreset.json using a presest configuration
10
+ # that leverages the vcpkg's toolchain file. This will automatically run vcpkg
11
+ # to install dependencies described by the vcpkg.json manifest file.
12
+ # This stage also runs vcpkg with Binary Caching leveraging GitHub Action cache to
13
+ # store the built packages artifacts, hence it will be a no-op if those are restored
14
+ # from cache (e.g., already previously built).
15
+ # - Finally builds the sources with Ninja, and tests as well.
16
+ name : ci
17
+ on :
18
+ push :
19
+ pull_request :
20
+
21
+ jobs :
22
+ job :
23
+ name : ${{ matrix.os }}-${{ github.workflow }}
24
+ runs-on : ${{ matrix.os }}
25
+ strategy :
26
+ fail-fast : false
27
+ matrix :
28
+ os : [ubuntu-latest, macos-latest, windows-latest, buildjet-2vcpu-ubuntu-2204-arm]
29
+ # env:
30
+ #
31
+ # [OPTIONAL] Define the vcpkg's triplet
32
+ # you want to enforce, otherwise the default one
33
+ # for the hosting system will be automatically
34
+ # choosen (x64 is the default on all platforms,
35
+ # e.g. x64-osx).
36
+ # VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
37
+
38
+ steps :
39
+ - uses : actions/checkout@v3
40
+ with :
41
+ submodules : true
42
+
43
+ - uses : lukka/get-cmake@latest
44
+
45
+ - name : Restore from cache and setup vcpkg executable and data files.
46
+ uses : lukka/run-vcpkg@v11
47
+ with :
48
+ vcpkgJsonGlob : ' vcpkg.json'
49
+
50
+ # Note: if the preset misses the "configuration", it is possible to explicitly select the
51
+ # configuration with the additional `--config` flag, e.g.:
52
+ # buildPreset: 'ninja-vcpkg'
53
+ # buildPresetAdditionalArgs: "[`--config`, `Release`]"
54
+ # testPreset: 'ninja-vcpkg'
55
+ # testPresetAdditionalArgs: "[`--config`, `Release`]"
56
+ - name : Run CMake+vcpkg+Ninja+CTest to build packages and generate/build/test the code.
57
+ uses : lukka/run-cmake@v10
58
+ with :
59
+ configurePreset : ' ninja-multi-vcpkg'
60
+ buildPreset : ' ninja-vcpkg-release'
61
+ testPreset : ' test-release'
62
+
63
+ - name : Set up Python 3.11
64
+ uses : actions/setup-python@v4
65
+ with :
66
+ python-version : 3.11
67
+
68
+ - name : Install Python dependencies
69
+ run : pip install -r test/requirements.txt
70
+
71
+ - name : Install pytest dependencies
72
+ run : pip install pytest-md pytest-emoji
73
+
74
+ - uses : pavelzw/pytest-action@v2
75
+ with :
76
+ custom-arguments : -p no:sugar
0 commit comments