name: CI implementation
on:
workflow_call:
inputs:
trusted:
required: true
type: boolean
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
MBX_DISABLE: "1"
jobs:
ci:
runs-on: ${{ github.event_name == 'pull_request' && (github.event.pull_request.head.repo.full_name != github.repository || github.event.pull_request.user.login != 'jdx') && 'ubuntu-latest' || 'namespace-profile-endev-linux-amd64;overrides.cache-tag=cache' }}
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 with:
persist-credentials: false
- uses: jdx/mise-action@08ae2a091c038e1e05ec6f5115dc5c69d5a2a6b8 - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 with:
shared-key: ci-rust
save-if: ${{ inputs.trusted && github.ref == 'refs/heads/main' }}
- run: rustup component add clippy rustfmt
- uses: taiki-e/install-action@c030abdc26abd91eb618a6c9d1963825f7ce5a90
- run: mise run render
- name: assert render produces no diff
run: |
if [ -n "$(git status --porcelain)" ]; then
echo "::error::'mise run render' produced changes. Run it locally and commit."
git status
git diff HEAD
exit 1
fi
- run: mise run lint
env:
JACTIONLINT_ONLINE: 1
GITHUB_TOKEN: ${{ github.token }}
- run: cargo test
- run: cargo audit