Repository navigation
132 lines (118 loc) · 6.04 KB
/
Copy pathci.yml
File metadata and controls
132 lines (118 loc) · 6.04 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Builds and tests wolf on Linux and Windows.
#
# The dependency tree comes from vcpkg through the manifest in scripts/vcpkg-manifest, with the
# in-repo ports in scripts/vcpkg-ports searched before the shared overlay. The vcpkg-workspace
# action checks out vcpkg and the overlay at the commits that scripts/vcpkg-sources.json specifies,
# installs the dependencies, caches the binary packages and reports the paths of the workspace.
name: ci
on:
push:
# The workflow runs on the integration branches as well as on main. Work stays on an
# integration branch for weeks before it reaches main, and a workflow restricted to main does
# not run in that period.
branches: [main, "linguistic-**"]
pull_request:
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-24.04
triplet: x64-linux
# The lang-packages feature installs the data packages from the release that the
# port pins, which is the only step that touches those URLs and SHA512 values.
# It covers test_ConvertedPackages; the cases that need the shared G2P model backend,
# which the port installs only with its non-default `multi` feature, or the voicebank
# fixture, which this workflow never generates, still skip here.
features: |
--x-feature=onnx
--x-feature=tests
--x-feature=lang-packages
options: ""
- os: windows-2022
triplet: x64-windows
features: |
--x-feature=onnx
--x-feature=tests
options: ""
runs-on: ${{ matrix.os }}
env:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }}
steps:
- uses: actions/checkout@v4
- name: Install build tools
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y ninja-build python3
- name: Set up the MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
- name: Install dependencies
id: vcpkg
uses: stdware/dev-scripts/actions/vcpkg-workspace@main
with:
triplet: ${{ matrix.triplet }}
install-args: ${{ matrix.features }}
- name: Generate the test fixture packages
# The packages are not committed; the tests that read them skip when they are absent, so
# this step keeps the fixture suite running in CI.
run: python3 scripts/make-test-fixtures.py --output build/test-fixtures
- name: Configure
shell: bash
run: |
cmake -S . -B build/cmake -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" \
-DVCPKG_INSTALLED_DIR="${{ steps.vcpkg.outputs.installed-dir }}" \
-DVCPKG_MANIFEST_MODE=OFF \
-DWOLF_TEST_FIXTURES_SOURCE="$PWD/build/test-fixtures" \
-DWOLF_BUILD_TESTS=ON ${{ matrix.options }}
- name: Build
run: cmake --build build/cmake
- name: Run the lint unit tests
run: python3 -m unittest discover -s scripts -p "test_*.py"
- name: Lint the shipped package
# The fixtures include deliberately broken packages, so the lint runs on the package that
# ships with the repository, which the step above generated with them. The pinned voicebank
# snapshot is added because it names the versions that were published, and a snapshot that
# no longer resolves is exactly the failure this job exists to catch.
run: python3 scripts/check-declarations.py build/test-fixtures/wolf-lang-zxx scripts/fixtures/voicebank-pinned
- name: Lint the release against the pinned snapshot
# Only the Linux job installs the release, and the compatibility-floor rule is checked only
# when the snapshot and the packages it names are given together: a dependency whose target
# is absent from the same run is skipped rather than checked.
if: runner.os == 'Linux'
run: |
python3 scripts/check-declarations.py scripts/fixtures/voicebank-pinned \
"${{ steps.vcpkg.outputs.installed-dir }}"/"$VCPKG_DEFAULT_TRIPLET"/share/wolf/packages/*
- name: Check the release pins against their copies
# The port verifies the pinned SHA512 against the archives it downloads. This step
# compares the same pins against the copies inside the repository, and reports the
# comparisons that a clean checkout cannot run instead of passing them silently.
run: python3 scripts/check-release-assets.py
- name: Test
# Data-dependent tests exit with the skip status when their packages are absent.
run: ctest --test-dir build/cmake --output-on-failure
- name: Check the installed CMake package
# The test suite above exercises the code, and this step exercises the installed package
# that a host consumes. The install rules write the targets, the include directories and
# the plugin tree of that package, and no earlier step reads them. The consumer is run, not
# only built, because it finds the plugin tree through the installed library at run time.
# Windows resolves the libraries through PATH; elsewhere the build tree rpath of the
# consumer already names them.
shell: bash
run: |
cmake --install build/cmake --prefix build/install
cmake -S .github/consumer -B build/consumer -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE="${{ steps.vcpkg.outputs.toolchain-file }}" \
-DVCPKG_INSTALLED_DIR="${{ steps.vcpkg.outputs.installed-dir }}" \
-DVCPKG_MANIFEST_MODE=OFF \
-DCMAKE_PREFIX_PATH="$PWD/build/install"
cmake --build build/consumer
if [ "$RUNNER_OS" = "Windows" ]; then
export PATH="$PWD/build/install/bin:$(cygpath -u '${{ steps.vcpkg.outputs.installed-dir }}')/$VCPKG_DEFAULT_TRIPLET/bin:$PATH"
fi
build/consumer/wolf_package_consumer