ci: apix-action updates #7
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: License compliance | |
| on: | |
| push: | |
| branches: | |
| - main | |
| - master | |
| pull_request: | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| env: | |
| CARGO_TERM_COLOR: always | |
| # Tool versions (adapt as needed; not required to match atlas-local-lib). | |
| CARGO_DENY_VERSION: "0.16.3" | |
| CARGO_ABOUT_VERSION: "0.9.1" | |
| jobs: | |
| check: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6 | |
| - name: Install Rust toolchain | |
| uses: dtolnay/rust-toolchain@4cda84d5c5c54efe2404f9d843567869ab1699d4 # stable | |
| with: | |
| toolchain: stable | |
| - uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6 | |
| with: | |
| python-version: "3.x" | |
| - name: Cache cargo registry | |
| uses: actions/cache@caa296126883cff596d87d8935842f9db880ef25 # v5 | |
| with: | |
| path: | | |
| ~/.cargo/registry | |
| ~/.cargo/git | |
| target | |
| key: ${{ runner.os }}-cargo-license-${{ hashFiles('**/Cargo.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-cargo-license- | |
| - name: Install cargo-binstall | |
| uses: cargo-bins/cargo-binstall@732870f031d2fb36309d0deaf36abcc704a7be65 # v1.20.1 | |
| - name: Install cargo-deny and cargo-about | |
| run: | | |
| cargo binstall --no-confirm --locked --version "${CARGO_DENY_VERSION}" cargo-deny | |
| cargo binstall --no-confirm --locked --version "${CARGO_ABOUT_VERSION}" cargo-about | |
| - name: Install package and Python tooling | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install . pip-licenses packaging | |
| # 1. Rust dependency license policy. | |
| - name: Check Rust dependency licenses | |
| run: cargo deny --all-features check licenses | |
| # 2. Python dependency license policy. | |
| - name: Check Python dependency licenses | |
| run: PYTHON="$(which python)" ./scripts/check-python-licenses.sh | |
| # 3. Regenerate LICENSE-3RD-PARTY.txt and fail if the checked-in copy is stale. | |
| - name: Regenerate LICENSE-3RD-PARTY.txt | |
| run: PYTHON="$(which python)" ./scripts/generate-third-party.sh | |
| - name: Fail if checked-in LICENSE-3RD-PARTY.txt is stale | |
| run: | | |
| if ! git diff --exit-code -- LICENSE-3RD-PARTY.txt; then | |
| echo "::error::LICENSE-3RD-PARTY.txt is out of date. Run ./scripts/generate-third-party.sh and commit the result." | |
| exit 1 | |
| fi |