ci(jans-cedarling): upgrade python version #1397
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: Cedarling Testcases | |
| on: | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "jans-cedarling/**" | |
| permissions: | |
| contents: read | |
| jobs: | |
| rust_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@1ff72ee08e3cb84d84adba594e0a297990fc1ed3 # stable | |
| - name: Run Tests | |
| working-directory: jans-cedarling | |
| run: | | |
| cargo test --workspace | |
| - name: Run Clippy on native target | |
| working-directory: jans-cedarling | |
| run: | | |
| rustup component add clippy | |
| cargo clippy --workspace --all-targets -- -D warnings | |
| rust_benchmarks: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@1ff72ee08e3cb84d84adba594e0a297990fc1ed3 # stable | |
| - name: Run benchmarks | |
| working-directory: jans-cedarling | |
| run: | | |
| cargo bench --profile release | |
| - name: Run script to analyze benchmarks | |
| working-directory: jans-cedarling | |
| run: | | |
| python3 scripts/check_benchmarks.py | |
| wasm_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Install chromium | |
| run: sudo apt-get update && sudo apt-get install chromium-chromedriver | |
| - name: Install Rust Stable | |
| uses: dtolnay/rust-toolchain@1ff72ee08e3cb84d84adba594e0a297990fc1ed3 # stable | |
| - name: Install specific wasm-pack version (v0.13.1) | |
| run: | | |
| curl -L https://github.com/rustwasm/wasm-pack/releases/download/v0.13.1/wasm-pack-v0.13.1-x86_64-unknown-linux-musl.tar.gz | tar xz -C /usr/local/bin --strip-components=1 | |
| wasm-pack --version | |
| - name: Clean project | |
| working-directory: jans-cedarling | |
| run: cargo clean | |
| - name: Run WASM tests using chrome | |
| working-directory: jans-cedarling/bindings/cedarling_wasm | |
| run: | | |
| wasm-pack test --headless --chrome | |
| - name: Run WASM tests using firefox | |
| working-directory: jans-cedarling/bindings/cedarling_wasm | |
| run: | | |
| wasm-pack test --headless --firefox | |
| - name: Run Clippy on WASM target | |
| working-directory: jans-cedarling | |
| run: | | |
| rustup component add clippy | |
| rustup target add wasm32-unknown-unknown | |
| cargo clippy -p cedarling_wasm --target wasm32-unknown-unknown -- -D warnings | |
| python_tests: | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| python-version: ["3.10", "3.11"] | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: Install dependencies | |
| run: | | |
| python3 -m pip install --upgrade pip || echo "Failed to upgrade pip" | |
| python3 -m pip install tox | |
| - name: Test with pytest | |
| working-directory: jans-cedarling/bindings/cedarling_python | |
| run: | | |
| tox | |
| golang_tests: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Harden Runner | |
| uses: step-security/harden-runner@a4aa98b93cab29d9b1101a6143fb8bce00e2eac4 # v2.7.1 | |
| with: | |
| egress-policy: audit | |
| - uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
| - name: Install Rust | |
| uses: dtolnay/rust-toolchain@1ff72ee08e3cb84d84adba594e0a297990fc1ed3 # stable | |
| - name: Install Golang dependencies | |
| uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5 | |
| with: | |
| go-version: '1.24' | |
| - name: Run build rust artifacts | |
| working-directory: jans-cedarling/bindings/cedarling_go | |
| run: | | |
| rustup component add clippy | |
| cargo build -r -p cedarling_go | |
| cp "../../target/release/libcedarling_go.so" "." | |
| - name: Install Go dependencies | |
| working-directory: jans-cedarling/bindings/cedarling_go | |
| run: | | |
| go mod download && go mod tidy | |
| - name: Run golang tests | |
| working-directory: jans-cedarling/bindings/cedarling_go | |
| run: | | |
| export LD_LIBRARY_PATH="$(pwd):${LD_LIBRARY_PATH}" | |
| go test . |