Replace lz4 and lzo with in-tree Rust #347
Workflow file for this run
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: Dissect CI | |
| on: | |
| push: | |
| branches: | |
| - main | |
| tags: | |
| - '*' | |
| pull_request: | |
| workflow_dispatch: | |
| jobs: | |
| ci: | |
| uses: fox-it/dissect-workflow-templates/.github/workflows/dissect-ci-template.yml@main | |
| secrets: inherit | |
| with: | |
| run-benchmarks: true | |
| build-native: | |
| runs-on: ${{ matrix.os }} | |
| continue-on-error: true | |
| strategy: | |
| matrix: | |
| os: [ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-11-arm, macos-13, macos-14] | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - run: git lfs install --local | |
| - name: Create LFS file list | |
| run: git lfs ls-files --long | cut -d ' ' -f1 | sort > .lfs-assets-id | |
| - name: Cache LFS | |
| uses: actions/cache@v4 | |
| with: | |
| path: .git/lfs | |
| key: lfs-${{ hashFiles('.lfs-assets-id') }}-v1 | |
| - name: Pull LFS | |
| run: git lfs pull | |
| - name: Setup QEMU (Linux only) | |
| if: runner.os == 'Linux' && runner.arch == 'X64' | |
| uses: docker/setup-qemu-action@v3 | |
| with: | |
| platforms: all | |
| - name: Setup Rust | |
| if: ${{ matrix.os != 'windows-11-arm' }} | |
| run: curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable | |
| - name: Setup Rust (Windows 11 ARM) | |
| if: ${{ matrix.os == 'windows-11-arm' }} | |
| run: | | |
| Invoke-WebRequest -Uri "https://win.rustup.rs/aarch64" -OutFile "$env:TEMP\rustup-init.exe" | |
| & "$env:TEMP\rustup-init.exe" -y | |
| "$env:USERPROFILE\.cargo\bin" | Out-File -Append -Encoding ascii $env:GITHUB_PATH | |
| "CARGO_HOME=$env:USERPROFILE\.cargo" | Out-File -Append -Encoding ascii $env:GITHUB_ENV | |
| shell: pwsh | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.13" | |
| - name: Install cibuildwheel | |
| run: python -m pip install cibuildwheel==2.23.2 | |
| - name: Build wheels | |
| run: python -m cibuildwheel --output-dir dist | |
| env: | |
| CIBW_ARCHS_LINUX: ${{ runner.arch == 'X64' && 'auto ppc64le s390x' || 'auto armv7l' }} | |
| CIBW_ARCHS_WINDOWS: ${{ runner.arch == 'X64' && 'AMD64 x86' || 'ARM64' }} | |
| CIBW_BEFORE_ALL_LINUX: curl -sSf https://sh.rustup.rs | sh -s -- -y | |
| CIBW_BEFORE_ALL_WINDOWS: ${{ runner.arch == 'X64' && 'rustup target add i686-pc-windows-msvc' || '' }} | |
| # Manually install setuptools-rust to enable building native wheels | |
| CIBW_BEFORE_BUILD: > | |
| python -m pip install -U setuptools>=77.0.0 setuptools_scm[toml]>=6.4.0 setuptools-rust | |
| CIBW_BUILD_FRONTEND: "build; args: --no-isolation" | |
| CIBW_CONFIG_SETTINGS: --build-option=--py-limited-api=cp39 | |
| CIBW_ENABLE: pypy | |
| CIBW_ENVIRONMENT_LINUX: PATH="$HOME/.cargo/bin:$PATH" | |
| CIBW_ENVIRONMENT_MACOS: MACOSX_DEPLOYMENT_TARGET=10.12 | |
| CIBW_SKIP: '*-musllinux_i686' | |
| # Run tests | |
| CIBW_TEST_REQUIRES: tox | |
| CIBW_TEST_COMMAND: tox -e native -c {package}/tox.ini --installpkg {wheel} | |
| - name: Run abi3audit | |
| run: pip install abi3audit && abi3audit --strict --report dist/*-abi3-*.whl | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: packages-native-${{ matrix.os }} | |
| path: dist/* | |
| retention-days: 1 | |
| publish: | |
| if: ${{ github.ref_name == 'main' || github.ref_type == 'tag' }} | |
| needs: [ci] | |
| runs-on: ubuntu-latest | |
| environment: dissect_publish | |
| permissions: | |
| id-token: write | |
| steps: | |
| - uses: actions/download-artifact@v4 | |
| with: | |
| pattern: packages-* | |
| path: dist/ | |
| # According to the documentation, it automatically looks inside the `dist/` folder for packages. | |
| - name: Publish package distributions to Pypi | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| trigger-tests: | |
| needs: [publish] | |
| uses: fox-it/dissect-workflow-templates/.github/workflows/dissect-ci-demand-test-template.yml@main | |
| secrets: inherit | |
| with: | |
| on-demand-test: 'dissect.target' |