Initial commit. #62
This file contains 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: "Cargo CI/CD" | |
on: | |
push: | |
pull_request: | |
jobs: | |
format: | |
name: cargo fmt | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: cargo fmt --check | |
checks: | |
name: cargo check | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: sudo apt-get update && sudo apt-get install -y libtss2-dev uuid-dev | |
- run: cargo check | |
tests: | |
name: cargo test | |
needs: | |
- format | |
- checks | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: sudo apt-get update && sudo apt-get install -y libtss2-dev uuid-dev | |
- run: make -C tools/docker/swtpm DETACH=1 | |
- run: RUST_LOG=info TSS2_LOG=all+none FAPI_RS_TEST_PROF=RSA2048SHA256 cargo test --tests | |
- run: RUST_LOG=info TSS2_LOG=all+none FAPI_RS_TEST_PROF=ECCP256SHA256 cargo test --tests | |
codecov: | |
name: llvm-cov | |
needs: | |
- format | |
- checks | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: sudo apt-get update && sudo apt-get install -y libtss2-dev uuid-dev | |
- run: cargo +stable install cargo-llvm-cov --locked | |
- run: make -C tools/docker/swtpm DETACH=1 | |
- run: PATH="/home/runner/.cargo/bin:${PATH}" ./tools/llvm-cov/code-coverage.sh html | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: code-coverage | |
path: target/llvm-cov/html | |
retention-days: 90 | |
build: | |
name: cargo build | |
needs: tests | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: sudo apt-get update && sudo apt-get install -y libtss2-dev uuid-dev | |
- run: cargo build --release | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: libtss2_fapi_rs | |
path: target/release/libtss2_fapi_rs.rlib | |
retention-days: 90 | |
docs: | |
name: cargo doc | |
needs: tests | |
runs-on: ubuntu-24.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- run: sudo apt-get update && sudo apt-get install -y libtss2-dev uuid-dev | |
- run: cargo doc --no-deps | |
- run: cp -f docs/public_html/index.html target/doc/index.html | |
- run: rm -f target/doc/.lock | |
- uses: actions/upload-pages-artifact@v3 | |
with: | |
path: target/doc/ | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# TODO: Re-enabled, once GitHub pages have been activated! | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | |
# deploy: | |
# name: deploy pages | |
# needs: docs | |
# if: github.ref == 'refs/heads/main' | |
# runs-on: ubuntu-24.04 | |
# permissions: | |
# pages: write | |
# id-token: write | |
# environment: | |
# name: github-pages | |
# url: ${{ steps.deployment.outputs.page_url }} | |
# steps: | |
# - name: Deploy to GitHub Pages | |
# id: deployment | |
# uses: actions/deploy-pages@v4 | |
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |