Skip to content

Commit fbe0a3e

Browse files
committed
Windows CI with 2 targets.
1 parent 24b10e6 commit fbe0a3e

File tree

1 file changed

+98
-76
lines changed

1 file changed

+98
-76
lines changed

.github/workflows/windows.yml

Lines changed: 98 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -3,89 +3,111 @@ name: Windows
33
on:
44
push:
55
branches:
6-
- '*'
6+
- '*'
77
pull_request:
88
branches: [ master-dev ]
99

1010
# Allows you to run this workflow manually from the Actions tab
1111
workflow_dispatch:
1212

1313
jobs:
14-
build:
14+
msvc-build:
1515
if: github.repository_owner == 'grame-cncm' || github.event_name == 'pull_request'
1616
runs-on: windows-latest
1717
steps:
18-
- uses: actions/checkout@v2
19-
20-
- name: Add MSBuild to PATH
21-
uses: microsoft/setup-msbuild@v1
22-
23-
- name: Get latest CMake and ninja
24-
uses: lukka/get-cmake@latest
25-
26-
- name: Build Faust
27-
run: |
28-
make -C build cmake BACKENDS=regular.cmake TARGETS=win-ci.cmake
29-
make -C build
30-
31-
- name: Run parser FileResolver tests
32-
shell: pwsh
33-
run: |
34-
$buildDir = "compiler\tests\parser\build-ci"
35-
if (Test-Path $buildDir) { Remove-Item $buildDir -Recurse -Force }
36-
New-Item -ItemType Directory -Force -Path $buildDir | Out-Null
37-
cl /nologo /std:c++17 /EHsc /I compiler compiler\tests\parser\test_file_resolver.cpp /Fe:$buildDir\file_resolver_tests.exe
38-
& "$buildDir\file_resolver_tests.exe"
39-
40-
- name: Compile example DSPs with Faust
41-
shell: bash
42-
run: |
43-
cat <<'PY' > compile_examples.py
44-
import pathlib
45-
import subprocess
46-
import sys
47-
48-
repo_root = pathlib.Path(".").resolve()
49-
faust = repo_root / "build" / "bin" / "faust.exe"
50-
if not faust.exists():
51-
faust = faust.with_suffix("")
52-
if not faust.exists():
53-
sys.exit(f"Faust executable not found at {faust}")
54-
55-
examples_root = repo_root / "examples"
56-
if not examples_root.exists():
57-
sys.exit(f"Examples directory not found at {examples_root}")
58-
59-
libraries_dir = repo_root / "libraries"
60-
61-
output_root = repo_root / "build" / "ci_examples"
62-
output_root.mkdir(parents=True, exist_ok=True)
63-
64-
failures = []
65-
66-
for dsp in sorted(examples_root.rglob("*.dsp")):
67-
rel = dsp.relative_to(examples_root)
68-
safe_name = "_".join(rel.parts).replace(".dsp", "")
69-
target = output_root / f"{safe_name}.cpp"
70-
cmd = [
71-
str(faust),
72-
"-lang",
73-
"cpp",
74-
"-I",
75-
str(libraries_dir),
76-
"-o",
77-
str(target),
78-
str(dsp),
79-
]
80-
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
81-
if result.returncode != 0:
82-
log = result.stderr if result.stderr else result.stdout
83-
failures.append((dsp, log))
84-
85-
if failures:
86-
for dsp, log in failures:
87-
print(f"--- Failed: {dsp} ---")
88-
print(log)
89-
sys.exit(f"{len(failures)} example DSP(s) failed to compile")
90-
PY
91-
python compile_examples.py
18+
- uses: actions/checkout@v3
19+
20+
- name: Add MSBuild to PATH
21+
uses: microsoft/setup-msbuild@v1
22+
23+
- name: Install latest CMake and Ninja
24+
uses: lukka/get-cmake@latest
25+
26+
- name: Configure and build Faust with MSVC
27+
shell: bash
28+
run: |
29+
make -C build cmake BACKENDS=regular.cmake TARGETS=win-ci.cmake
30+
make -C build
31+
32+
msys2-build-test:
33+
needs: msvc-build
34+
if: github.repository_owner == 'grame-cncm' || github.event_name == 'pull_request'
35+
runs-on: windows-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
39+
- name: Set up MSYS2 toolchain
40+
uses: msys2/setup-msys2@v2
41+
with:
42+
msystem: MINGW64
43+
update: true
44+
install: >-
45+
base-devel
46+
git
47+
make
48+
python
49+
mingw-w64-x86_64-toolchain
50+
51+
- name: Build Faust with MSYS2
52+
shell: msys2 {0}
53+
run: |
54+
make -C build cmake BACKENDS=regular.cmake TARGETS=win-ci.cmake
55+
make -C build
56+
57+
- name: Run parser FileResolver tests
58+
shell: msys2 {0}
59+
run: |
60+
cd compiler/tests/parser
61+
make clean
62+
make run
63+
64+
- name: Compile sample DSPs with Faust
65+
shell: msys2 {0}
66+
run: |
67+
python - <<'PY'
68+
import pathlib
69+
import subprocess
70+
import sys
71+
72+
repo_root = pathlib.Path(".").resolve()
73+
faust = repo_root / "build" / "bin" / "faust"
74+
if not faust.exists():
75+
faust = faust.with_suffix(".exe")
76+
if not faust.exists():
77+
sys.exit(f"Faust executable not found at {faust}")
78+
79+
examples_root = repo_root / "examples"
80+
if not examples_root.exists():
81+
sys.exit(f"Examples directory not found at {examples_root}")
82+
83+
libraries_dir = repo_root / "libraries"
84+
output_root = repo_root / "build" / "ci_examples"
85+
output_root.mkdir(parents=True, exist_ok=True)
86+
87+
failures = []
88+
89+
for dsp in sorted(examples_root.rglob("*.dsp")):
90+
rel = dsp.relative_to(examples_root)
91+
safe_name = "_".join(rel.parts).replace(".dsp", "")
92+
target = output_root / f"{safe_name}.cpp"
93+
cmd = [
94+
str(faust),
95+
"-lang",
96+
"cpp",
97+
"-I",
98+
str(libraries_dir),
99+
"-o",
100+
str(target),
101+
str(dsp),
102+
]
103+
result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)
104+
if result.returncode != 0:
105+
log = result.stderr if result.stderr else result.stdout
106+
failures.append((dsp, log))
107+
108+
if failures:
109+
for dsp, log in failures:
110+
print(f"--- Failed: {dsp} ---")
111+
print(log)
112+
sys.exit(f"{len(failures)} example DSP(s) failed to compile")
113+
PY

0 commit comments

Comments
 (0)