Prepare 2.2.6 release (#114) #270
Workflow file for this run
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: ci | |
on: | |
pull_request: | |
types: | |
- opened | |
- synchronize | |
- reopened | |
push: | |
branches: | |
- main | |
tags: | |
- "[0-9]+.[0-9]+.[0-9]+" | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- name: Run the unit/doc tests | |
run: cargo test | |
- name: Test examples | |
run: | | |
EXAMPLES="simple | |
with-report | |
with-style | |
with-resume | |
" | |
for example in $EXAMPLES; do | |
echo "==== Testing $example =======================================" | |
cargo run -q --example "$example" | |
echo "=============================================================" | |
done | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: extractions/setup-just@v2 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo fmt --all -- --check | |
- run: cargo check | |
- run: cargo clippy -- -D warnings | |
- name: Lint markdown | |
run: just lint-md | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build | |
# Disabling this for now since it does not really add a lot of value but does | |
# add a lot of CI time. | |
# attest: | |
# needs: | |
# - build | |
# - lint | |
# - test | |
# runs-on: ubuntu-latest | |
# if: startsWith(github.ref, 'refs/tags/') | |
# steps: | |
# - uses: actions/checkout@v4 | |
# - uses: dtolnay/rust-toolchain | |
# with: | |
# profile: minimal | |
# toolchain: stable | |
# override: true | |
# - uses: Swatinem/rust-cache@v2 | |
# # Generate attestation. | |
# - uses: actions-rs/cargo@v1 | |
# with: | |
# command: package | |
# - run: | | |
# mkdir -p dist | |
# cp target/package/*.crate dist/ | |
# - name: Generate provenance | |
# uses: slsa-framework/github-actions-demo@v0.1 | |
# with: | |
# artifact_path: dist/ | |
# output_path: trauma.${{ github.sha }}.att | |
# # Sign the attestation. | |
# - uses: sigstore/cosign-installer@main | |
# - run: | | |
# export COSIGN_PASSWORD="${{ secrets.COSIGN_PASSWORD }}" | |
# echo -n "${{ secrets.COSIGN_KEY }}" > /tmp/cosign.key | |
# cosign sign-blob --key /tmp/cosign.key trauma.${{ github.sha }}.att > trauma.${{ github.sha }}.sig | |
# # Upload attestation files. | |
# - name: Upload provenance | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# path: | | |
# trauma.${{ github.sha }}.att | |
# trauma.${{ github.sha }}.sig | |
release: | |
needs: | |
- build | |
- lint | |
- test | |
runs-on: ubuntu-latest | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: Swatinem/rust-cache@v2 | |
- uses: actions/download-artifact@v4 | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
- name: Publish the release | |
uses: softprops/action-gh-release@v2 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
- run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} |