Rework printLibDir, printIncludeDir, printArchDir, printDspDir, print… #2736
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Windows | |
| on: | |
| push: | |
| branches: | |
| - '*' | |
| pull_request: | |
| branches: [ master-dev ] | |
| # Allows you to run this workflow manually from the Actions tab | |
| workflow_dispatch: | |
| jobs: | |
| msvc-build: | |
| if: github.repository_owner == 'grame-cncm' || github.event_name == 'pull_request' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Add MSBuild to PATH | |
| uses: microsoft/setup-msbuild@v1 | |
| - name: Install latest CMake and Ninja | |
| uses: lukka/get-cmake@latest | |
| - name: Configure and build Faust with MSVC | |
| shell: bash | |
| run: | | |
| make -C build cmake BACKENDS=regular.cmake TARGETS=win-ci.cmake | |
| make -C build | |
| msys2-build-test: | |
| needs: msvc-build | |
| if: github.repository_owner == 'grame-cncm' || github.event_name == 'pull_request' | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v3 | |
| - name: Set up MSYS2 toolchain | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: true | |
| install: >- | |
| base-devel | |
| git | |
| make | |
| python | |
| mingw-w64-x86_64-toolchain | |
| - name: Build Faust with MSYS2 | |
| shell: msys2 {0} | |
| run: | | |
| make -C build cmake BACKENDS=regular.cmake TARGETS=win-ci.cmake | |
| make -C build | |
| - name: Run parser FileResolver tests | |
| shell: msys2 {0} | |
| run: | | |
| cd compiler/tests/parser | |
| make clean | |
| make run | |
| - name: Compile sample DSPs with Faust | |
| shell: msys2 {0} | |
| run: | | |
| python - <<'PY' | |
| import pathlib | |
| import subprocess | |
| import sys | |
| repo_root = pathlib.Path(".").resolve() | |
| faust = repo_root / "build" / "bin" / "faust" | |
| if not faust.exists(): | |
| faust = faust.with_suffix(".exe") | |
| if not faust.exists(): | |
| sys.exit(f"Faust executable not found at {faust}") | |
| examples_root = repo_root / "examples" | |
| if not examples_root.exists(): | |
| sys.exit(f"Examples directory not found at {examples_root}") | |
| libraries_dir = repo_root / "libraries" | |
| output_root = repo_root / "build" / "ci_examples" | |
| output_root.mkdir(parents=True, exist_ok=True) | |
| failures = [] | |
| for dsp in sorted(examples_root.rglob("*.dsp")): | |
| rel = dsp.relative_to(examples_root) | |
| safe_name = "_".join(rel.parts).replace(".dsp", "") | |
| target = output_root / f"{safe_name}.cpp" | |
| cmd = [ | |
| str(faust), | |
| "-lang", | |
| "cpp", | |
| "-I", | |
| str(libraries_dir), | |
| "-o", | |
| str(target), | |
| str(dsp), | |
| ] | |
| result = subprocess.run(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) | |
| if result.returncode != 0: | |
| log = result.stderr if result.stderr else result.stdout | |
| failures.append((dsp, log)) | |
| if failures: | |
| for dsp, log in failures: | |
| print(f"--- Failed: {dsp} ---") | |
| print(log) | |
| sys.exit(f"{len(failures)} example DSP(s) failed to compile") | |
| PY |