Skip to content

Merge pull request #1907 from teor2345/overloading-experiment #5275

Merge pull request #1907 from teor2345/overloading-experiment

Merge pull request #1907 from teor2345/overloading-experiment #5275

Workflow file for this run

name: CI
on:
push:
branches:
- main
pull_request:
merge_group:
env:
# renovate: datasource=github-tags depName=rust lookupName=rust-lang/rust
RUST_VERSION: 1.97.1
ZOLA_VERSION: 29540e9897dbe8aca388b13f7bdf615985f6ca2c
jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: rustup override set ${{ env.RUST_VERSION }}
- run: rustup component add clippy
- run: rustup component add rustfmt
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo clippy --workspace -- -D warnings
- run: cargo fmt --check --all
- run: cargo test --package front_matter
spelling:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- uses: crate-ci/typos@bee27e3a4fd1ea2111cf90ab89cd076c870fce14 # v1.48.0
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: rustup override set ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
with:
env-vars: CARGO RUST ZOLA_VERSION
- name: Install Zola
run: cargo install --locked --git https://github.com/getzola/zola --rev ${{ env.ZOLA_VERSION }}
- run: zola build
- run: cp CNAME ./public/
- run: touch public/.nojekyll
- uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa # v3.0.1
with:
path: public
pub_date:
name: Check publication date for placeholder
if: ${{ github.event_name == 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4
- run: rustup override set ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
- run: cargo test -p front_matter -- --include-ignored date_is_set
deploy:
if: ${{ github.event_name == 'merge_group' }}
needs: [ pub_date, build ]
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
# Summary job for the merge queue.
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
conclusion:
# Keep `name` matching the status check.
name: CI
needs:
- lint
- spelling
- build
- pub_date
- deploy
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
env:
NEEDS: ${{ toJson(needs) }}
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< "$NEEDS"
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success" or .result == "skipped")' <<< "$NEEDS"