Skip to content

ci

ci #837

Workflow file for this run

name: ci
on:
push:
pull_request:
schedule: [cron: "40 1 * * *"]
permissions:
contents: read
env:
CARGO_TERM_COLOR: always
jobs:
# checklinks:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v4
# - uses: trevyn/lychee-action@v1
# id: lychee
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# args: --verbose --no-progress --header="accept=text/html" "**/*.md" "**/*.rs" "**/*.json" "**/*.toml" "**/*.yml"
# - name: Fail if there were link-check errors
# run: exit ${{ steps.lychee.outputs.exit_code }}
test:
name: test rust ${{ matrix.rust }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
rust: ["1.56.1", stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- run: rustup default ${{ matrix.rust }} && rustup update ${{ matrix.rust }}
- name: cargo test tracked-impl
run: cargo test -- --nocapture
working-directory: "tracked-impl"
- name: cargo test tracked
run: cargo test -- --nocapture
working-directory: "tracked"
- run: cargo doc --no-deps
todo-or-die:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup default nightly && rustup update nightly
- run: >
echo -e "\n[dev-dependencies]\ntodo-or-die = {version = \"0.1\", features = [\"github\"]}\n\n[features]\ntodoordie = []" >> tracked-impl/Cargo.toml
- run: cargo test --features todoordie -- --nocapture
working-directory: "tracked-impl"
publish:
needs: [test, todo-or-die]
runs-on: ubuntu-latest
if: ${{ startsWith(github.event.head_commit.message, 'tracked@') && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- run: rustup default stable && rustup update stable
- name: cargo publish tracked-impl
run: cargo publish --no-verify --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
working-directory: "tracked-impl"
- name: cargo publish tracked
run: cargo publish --no-verify --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
working-directory: "tracked"