build: fix feature flags in meson #13
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
| # | |
| # Continuous Integration | |
| # | |
| # This is the main entry-point of the continuous integration of this project. | |
| # It is triggered by pull-requests and pushes, but can optionally be manually | |
| # triggered via the GitHub APIs. | |
| # | |
| # This workflow first runs sanity tests, a very basic build, and the test-suite | |
| # with default configurations. Only if all these succeed it will proceed and | |
| # spawn the more elaborate test-suite. This ensures that simple bugs are caught | |
| # early and do not trigger the full test-suite, fuzzers, or static analyzers. | |
| # | |
| # This workflow triggers on any pull-request and push, except for pushes to | |
| # branches called `pr/*`. This is a workaround for GitHub which can be used to | |
| # avoid running the test-suite on PR branches, and only run it in the PR | |
| # itself. For example, a push to a forked repository `dvdhrm/sys` named | |
| # `pr/syscalls` will not trigger the CI of the forked repository for this push. | |
| # However, once a PR is filed against `bus1/sys`, the pull-request trigger will | |
| # run the CI. This workaround avoids running the CI twice, once in the fork and | |
| # once upstream. However, this workaround still allows running the CI in forks | |
| # by simply using branches other than `pr/*`. | |
| # | |
| # Lastly, the continuous integration can be triggered manually via the | |
| # workflow-dispatch trigger, either via the GitHub API or via the GitHub UI. | |
| # | |
| name: "Continuous Integration" | |
| on: | |
| pull_request: | |
| push: | |
| branches-ignore: ["pr/**"] | |
| tags: ["**"] | |
| workflow_dispatch: | |
| defaults: | |
| run: | |
| shell: "bash" | |
| env: | |
| CC: clang | |
| CC_LD: lld | |
| CI_MESON_ARGS: >- | |
| --buildtype debugoptimized | |
| --warnlevel 2 | |
| -D debug=true | |
| -D errorlogs=true | |
| -D werror=true | |
| -D doctest=true | |
| -D libc=false | |
| jobs: | |
| # | |
| # Run the Rust static analyzer (clippy) on the code-base and report any | |
| # violations of the configured rules. | |
| # | |
| basic_clippy: | |
| name: "Basic: clippy" | |
| container: | |
| image: "ghcr.io/readaheadeu/rae-ci-archlinux:latest" | |
| options: "--user root" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Run Analyzer" | |
| run: cargo check --all-features --all-targets --verbose --workspace | |
| # | |
| # A complete but basic build of the project, running on common x86-64 ubuntu | |
| # machines. This should catch most compilation errors or test-suite failures | |
| # but runs pretty fast. No fuzzing, benchmarking, sanitizing, or other long | |
| # running operations are done. | |
| # | |
| basic_cargo: | |
| name: "Basic: basic @ Ubuntu-x86_64-stable-release" | |
| container: | |
| image: "ghcr.io/readaheadeu/rae-ci-ubuntu:latest" | |
| options: "--user root" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Build and Test" | |
| run: cargo test --all-features --all-targets --verbose --workspace | |
| # | |
| # A simple no-op job that serves as guard. All extended jobs depend on this | |
| # job, and thus we can accumulate the basic dependencies here, instead of | |
| # duplicating them everywhere. | |
| # | |
| ext_guard: | |
| name: "Guard Ext-Jobs" | |
| needs: | |
| - basic_clippy | |
| - basic_cargo | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "No-op" | |
| run: | | |
| # | |
| # A release build running on ARM64. All supported features are enabled and | |
| # the full test suite is run. | |
| # | |
| ext_arm64: | |
| name: "Ext: arm64 @ Ubuntu-arm64-stable-release" | |
| needs: ext_guard | |
| container: | |
| image: "ghcr.io/readaheadeu/rae-ci-ubuntu:latest" | |
| options: "--user root" | |
| runs-on: "ubuntu-24.04-arm" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Build and Test" | |
| run: cargo test --all-features --all-targets --verbose --workspace | |
| # | |
| # A matrix of project builds with different settings. All builds run the | |
| # included test suite. This includes builds with and without debug options, | |
| # optimizations, and build options. | |
| # | |
| ext_cargo: | |
| name: "Ext: ${{ matrix.id }} @ ${{ matrix.name }}" | |
| needs: ext_guard | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| # Test a release build as recommended by upstream. | |
| - id: "release" | |
| name: "Arch-x86_64-stable-release" | |
| # Explicitly set all options here to document them. | |
| cargoargs: >- | |
| --all-features | |
| --all-targets | |
| --profile=release | |
| image: "ghcr.io/readaheadeu/rae-ci-archlinux:latest" | |
| toolchain: stable | |
| # Test a nightly build with release configuration. | |
| - id: "nightly" | |
| name: "Ubuntu-x86_64-nightly-release" | |
| cargoargs: >- | |
| --all-features | |
| --all-targets | |
| --profile=release | |
| image: "ghcr.io/readaheadeu/rae-ci-ubuntu:latest" | |
| toolchain: nightly | |
| container: | |
| image: ${{ matrix.image }} | |
| options: "--user root" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Configure Rust Toolchain" | |
| run: rustup default "${{ matrix.toolchain }}" | |
| - name: "Build and Test" | |
| run: | | |
| cargo \ | |
| test \ | |
| --verbose \ | |
| --workspace \ | |
| ${{ matrix.cargoargs }} | |
| # | |
| # A release build running on i686. All supported features are enabled and the | |
| # full test suite is run. | |
| # | |
| ext_i686: | |
| name: "Ext: i686 @ Arch-i686-stable-release" | |
| needs: ext_guard | |
| container: | |
| image: "ghcr.io/readaheadeu/rae-ci-archlinux:latest" | |
| options: "--user root" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Build and Test" | |
| run: | | |
| cargo \ | |
| test \ | |
| --all-features \ | |
| --all-targets \ | |
| --target i686-unknown-linux-gnu \ | |
| --verbose \ | |
| --workspace | |
| # | |
| # A development build using the meson build system. | |
| # | |
| ext_meson: | |
| name: "Ext: meson @ Arch-x86_64-stable-release" | |
| needs: ext_guard | |
| container: | |
| image: "ghcr.io/readaheadeu/rae-ci-archlinux:latest" | |
| options: "--user root" | |
| runs-on: "ubuntu-latest" | |
| steps: | |
| - name: "Fetch Sources" | |
| uses: actions/checkout@v4 | |
| - name: "Setup Meson" | |
| run: meson setup ${CI_MESON_ARGS} ./build . | |
| - name: "Compile Project" | |
| run: meson compile -C "./build" | |
| - name: "Run Tests" | |
| run: meson test -C "./build" |