chore(deps): update vmactions/freebsd-vm action to v1.5.5 #29870
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: Code Quality | |
| # spell-checker:ignore (people) juliangruber pell reactivecircus taiki-e taplo | |
| # spell-checker:ignore (misc) TERMUX noaudio pkill swiftshader esac sccache pcoreutils shopt subshell dequote libsystemd oniguruma sysroot wasi wasip | |
| on: | |
| pull_request: | |
| push: | |
| branches: | |
| - '*' | |
| env: | |
| CARGO_INCREMENTAL: "0" | |
| # * style job configuration | |
| STYLE_FAIL_ON_FAULT: true ## (bool) fail the build if a style job contains a fault (error or warning); may be overridden on a per-job basis | |
| permissions: | |
| contents: read # to fetch code (actions/checkout) | |
| # End the current execution if there is a new changeset in the PR. | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} | |
| jobs: | |
| style_format: | |
| name: Style/format | |
| runs-on: ${{ matrix.job.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| job: | |
| - { os: ubuntu-latest , features: feat_os_unix } | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize workflow variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| ## VARs setup | |
| outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; } | |
| # failure mode | |
| unset FAIL_ON_FAULT ; case "$STYLE_FAIL_ON_FAULT" in | |
| ''|0|f|false|n|no|off) FAULT_TYPE=warning ;; | |
| *) FAIL_ON_FAULT=true ; FAULT_TYPE=error ;; | |
| esac; | |
| outputs FAIL_ON_FAULT FAULT_TYPE | |
| - name: "`cargo fmt` testing" | |
| shell: bash | |
| run: | | |
| ## `cargo fmt` testing | |
| unset fault | |
| fault_type="${{ steps.vars.outputs.FAULT_TYPE }}" | |
| fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]') | |
| # * convert any errors/warnings to GHA UI annotations; ref: <https://help.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-a-warning-message> | |
| S=$(cargo fmt -- --check) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s\n" "$S" | sed -E -n -e "s/^Diff[[:space:]]+in[[:space:]]+${PWD//\//\\/}\/(.*)[[:space:]]+at[[:space:]]+[^0-9]+([0-9]+).*$/::${fault_type} file=\1,line=\2::${fault_prefix}: \`cargo fmt\`: style violation (file:'\1', line:\2; use \`cargo fmt -- \"\1\"\`)/p" ; fault=true ; } | |
| if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi | |
| - name: "cargo fmt on fuzz dir" | |
| shell: bash | |
| run: | | |
| cd fuzz | |
| cargo fmt --check | |
| style_lint: | |
| name: Style/lint | |
| runs-on: ${{ matrix.job.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| job: | |
| - { os: ubuntu-latest , features: all , workspace: true } | |
| - { os: macos-latest , features: all , workspace: true } | |
| - { os: windows-latest , features: feat_os_windows } | |
| - { os: ubuntu-latest , features: feat_wasm , target: wasm32-wasip1 } | |
| - { os: ubuntu-latest , features: feat_wasm , target: wasm32-wasip2 } | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: dtolnay/rust-toolchain@master | |
| with: | |
| toolchain: stable | |
| components: clippy | |
| targets: ${{ matrix.job.target || '' }} | |
| - uses: Swatinem/rust-cache@v2 | |
| - name: Run sccache-cache | |
| id: sccache-setup | |
| uses: mozilla-actions/sccache-action@v0.0.11 | |
| continue-on-error: true | |
| - name: Export sccache | |
| if: steps.sccache-setup.outcome == 'success' | |
| run: | | |
| echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | |
| echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | |
| - name: Initialize workflow variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| ## VARs setup | |
| outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; } | |
| # failure mode | |
| unset FAIL_ON_FAULT ; case "$STYLE_FAIL_ON_FAULT" in | |
| ''|0|f|false|n|no|off) FAULT_TYPE=warning ;; | |
| *) FAIL_ON_FAULT=true ; FAULT_TYPE=error ;; | |
| esac; | |
| outputs FAIL_ON_FAULT FAULT_TYPE | |
| - name: Install/setup prerequisites | |
| if: ${{ ! matrix.job.target }} | |
| shell: bash | |
| run: | | |
| ## Install/setup prerequisites | |
| case '${{ matrix.job.os }}' in | |
| ubuntu-*) | |
| sudo apt-get -y update | |
| # selinux and systemd headers needed to enable all features | |
| sudo apt-get -y install libselinux1-dev libsystemd-dev | |
| ;; | |
| esac | |
| - name: "`cargo clippy` lint testing" | |
| uses: nick-fields/retry@v4 | |
| with: | |
| max_attempts: 3 | |
| retry_on: error | |
| timeout_minutes: 90 | |
| shell: bash | |
| command: | | |
| ## `cargo clippy` lint testing | |
| ARGS="--features ${{ matrix.job.features }}" | |
| ARGS="${ARGS} --fault-type ${{ steps.vars.outputs.FAULT_TYPE }}" | |
| if [[ "${{ matrix.job.workspace }}" =~ ^(1|t|true|y|yes)$ ]]; then | |
| ARGS="${ARGS} --workspace" | |
| fi | |
| if [[ -n "${{ matrix.job.target }}" ]]; then | |
| ARGS="${ARGS} --target ${{ matrix.job.target }}" | |
| fi | |
| if [[ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ]]; then | |
| ARGS="${ARGS} --fail-on-fault" | |
| fi | |
| python3 util/run-clippy.py ${ARGS} | |
| - name: "cargo clippy on fuzz dir" | |
| if: runner.os != 'Windows' && !matrix.job.target | |
| shell: bash | |
| run: | | |
| cd fuzz | |
| cargo clippy --workspace --all-targets --all-features -- -D warnings | |
| style_spellcheck: | |
| name: Style/spelling | |
| runs-on: ${{ matrix.job.os }} | |
| env: | |
| # Spelling is enforced locally by the cspell pre-commit hook, where it is | |
| # cheap to fix. Here it is advisory: unknown words show up as annotations | |
| # on the diff instead of blocking the merge. | |
| STYLE_FAIL_ON_FAULT: false | |
| strategy: | |
| matrix: | |
| job: | |
| - { os: ubuntu-latest , features: feat_os_unix } | |
| steps: | |
| - uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Initialize workflow variables | |
| id: vars | |
| shell: bash | |
| run: | | |
| ## VARs setup | |
| outputs() { step_id="${{ github.action }}"; for var in "$@" ; do echo steps.${step_id}.outputs.${var}="${!var}"; echo "${var}=${!var}" >> $GITHUB_OUTPUT; done; } | |
| # failure mode | |
| unset FAIL_ON_FAULT ; case "$STYLE_FAIL_ON_FAULT" in | |
| ''|0|f|false|n|no|off) FAULT_TYPE=warning ;; | |
| *) FAIL_ON_FAULT=true ; FAULT_TYPE=error ;; | |
| esac; | |
| outputs FAIL_ON_FAULT FAULT_TYPE | |
| - name: Install/setup prerequisites | |
| shell: bash | |
| run: | | |
| sudo npm install cspell -g ; | |
| - name: Run `cspell` | |
| shell: bash | |
| run: | | |
| ## Run `cspell` | |
| unset fault | |
| fault_type="${{ steps.vars.outputs.FAULT_TYPE }}" | |
| fault_prefix=$(echo "$fault_type" | tr '[:lower:]' '[:upper:]') | |
| # * find cspell configuration ; note: avoid quotes around ${cfg_file} b/c `cspell` (v4) doesn't correctly dequote the config argument (or perhaps a subshell expansion issue?) | |
| cfg_files=($(shopt -s nullglob ; echo {.vscode,.}/{,.}c[sS]pell{.json,.config{.js,.cjs,.json,.yaml,.yml},.yaml,.yml} ;)) | |
| cfg_file=${cfg_files[0]} | |
| unset CSPELL_CFG_OPTION ; if [ -n "$cfg_file" ]; then CSPELL_CFG_OPTION="--config $cfg_file" ; fi | |
| S=$(cspell ${CSPELL_CFG_OPTION} --no-summary --no-progress .) && printf "%s\n" "$S" || { printf "%s\n" "$S" ; printf "%s" "$S" | sed -E -n "s/^(.*):([0-9]+):([0-9]+) - Unknown word \(([^)]+)\).*$/::${fault_type} file=\1,line=\2,col=\3::${fault_type^^}: \`cspell\`: Unknown word '\4' (file:'\1', line:\2)/p" ; fault=true ; true ; } | |
| if [ -n "${{ steps.vars.outputs.FAIL_ON_FAULT }}" ] && [ -n "$fault" ]; then exit 1 ; fi | |
| style_empty_assertions: | |
| name: Style/Empty assertions check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Fail if empty stdout/stderr assertions are found | |
| shell: bash | |
| run: | | |
| if grep -rnE '(stdout_is|stderr_is)\(""\)' tests/; then | |
| echo "::error::Found empty stdout/stderr assertions (use specific checks instead of \"\") in tests/" | |
| exit 1 | |
| fi | |
| python: | |
| name: Style/Python | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Clone repository | |
| uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: ruff | |
| uses: astral-sh/ruff-action@v4.1.0 | |
| with: | |
| src: "./util" | |
| - name: ruff - format | |
| uses: astral-sh/ruff-action@v4.1.0 | |
| with: | |
| src: "./util" | |
| args: format --check | |
| - name: Run Python unit tests | |
| shell: bash | |
| run: | | |
| python3 -m unittest util/test_compare_test_results.py util/test_compare_size_results.py | |
| pre_commit: | |
| name: Pre-commit hooks | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Cache Rust dependencies | |
| uses: Swatinem/rust-cache@v2 | |
| - name: Install pre-commit | |
| run: pip install pre-commit | |
| - name: Cache pre-commit environments | |
| uses: actions/cache@v6 | |
| with: | |
| path: ~/.cache/pre-commit | |
| key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }} | |
| restore-keys: | | |
| pre-commit-${{ runner.os }}- | |
| - name: Run pre-commit | |
| env: | |
| # cspell is enforced locally and reported by Style/spelling; the rust | |
| # hooks are already covered by the Style/format and Style/lint jobs. | |
| SKIP: cspell,rust-linting,rust-clippy,cargo-lock-check | |
| run: pre-commit run --all-files --show-diff-on-failure |