Skip to content

ci

ci #1746

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.77.2", stable, beta, nightly]
steps:
- uses: actions/checkout@v4
- run: rustup default ${{ matrix.rust }} && rustup update ${{ matrix.rust }}
- name: Enable type layout randomization
run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV
if: matrix.rust == 'nightly'
- name: cargo test turbosql-impl
run: cargo test --features "test" -- --nocapture --test-threads=1
working-directory: "turbosql-impl"
- name: cargo test turbosql
run: cargo test --features "test" -- --nocapture --test-threads=1
working-directory: "turbosql"
- run: cargo doc --no-deps
- run: >
echo -e "\n[patch.crates-io]\nrusqlite = {git = \"https://github.com/rusqlite/rusqlite\", branch = \"master\"}" >> Cargo.toml
- run: cargo clean
- name: rusqlite master cargo test turbosql-impl
if: matrix.rust == 'stable' || matrix.rust == 'beta' || matrix.rust == 'nightly'
run: cargo test --features "test" -- --nocapture --test-threads=1 --skip ui
working-directory: "turbosql-impl"
- name: rusqlite master cargo test turbosql
if: matrix.rust == 'stable' || matrix.rust == 'beta' || matrix.rust == 'nightly'
run: cargo test --features "test" -- --nocapture --test-threads=1 --skip ui
working-directory: "turbosql"
minimal-versions:
name: test minimal-versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: rustup default nightly && rustup update nightly
- run: cargo update
- uses: taiki-e/install-action@cargo-hack
- uses: taiki-e/install-action@cargo-minimal-versions
- run: cargo minimal-versions check --direct
- run: cargo minimal-versions test --direct --features test -- --test-threads=1
- run: cargo minimal-versions doc --direct --no-deps
publish:
needs: [test, minimal-versions]
runs-on: ubuntu-latest
if: ${{ contains(github.event.head_commit.message, 'turbosql@') && github.event_name == 'push' && github.ref == 'refs/heads/main' }}
steps:
- uses: actions/checkout@v4
- run: rustup default stable && rustup update stable
- name: cargo publish turbosql-impl
run: cargo publish --no-verify --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
working-directory: "turbosql-impl"
- name: cargo publish turbosql
run: cargo publish --no-verify --allow-dirty --token ${{ secrets.CARGO_TOKEN }}
working-directory: "turbosql"