This repository has been archived by the owner on Mar 10, 2024. It is now read-only.
chore: Configure Renovate - autoclosed #11
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: main | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
# skip ci if the last commit contains the appropriate tag | |
skip-commit: | |
name: Conditionally skip ci | |
runs-on: ubuntu-latest | |
steps: | |
- if: "contains(github.event.head_commit.message, '[skip-ci]') | |
|| contains(github.event.head_commit.message, '[skip ci]') | |
|| contains(github.event.head_commit.message, '[ci-skip]') | |
|| contains(github.event.head_commit.message, '[ci skip]')" | |
run: exit 78 | |
# verify that Cargo.lock passes audit | |
cargo-audit: | |
name: Run cargo audit | |
needs: [skip-commit] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Fetch latest release version of cargo-audit | |
run: | | |
mkdir -p .github/caching | |
cargo search cargo-audit | grep '^cargo-audit' | awk '{gsub(/"/,"",$3); print $3}' > .github/caching/cargo-audit.lock | |
- name: Cache cargo-audit/bin | |
id: cache-cargo-audit | |
uses: actions/cache@v1 | |
with: | |
path: ${{ runner.tool_cache }}/cargo-audit/bin | |
key: cargo-audit-bin-${{ hashFiles('.github/caching/cargo-audit.lock') }} | |
- name: Install cargo-audit | |
if: "steps.cache-cargo-audit.outputs.cache-hit != 'true'" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: --root ${{ runner.tool_cache }}/cargo-audit --force cargo-audit | |
- run: echo "${{ runner.tool_cache }}/cargo-audit/bin" >> $GITHUB_PATH | |
- run: cargo audit | |
# verify that project passes clippy lints | |
cargo-clippy: | |
name: Run cargo clippy | |
needs: [skip-commit] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
components: clippy | |
- name: Install node dependencies | |
run: npm ci | |
- name: Run cargo clippy | |
uses: actions-rs/clippy-check@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
args: --all-targets --workspace -- -D warnings | |
# build the documentation | |
cargo-docs: | |
name: Run cargo docs | |
needs: [skip-commit] | |
runs-on: ubuntu-latest | |
env: | |
RUST_TOOLCHAIN: nightly | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
profile: minimal | |
override: true | |
- name: Run cargo xtask doc | |
uses: actions-rs/cargo@v1 | |
with: | |
command: xtask | |
args: doc -- --no-deps --package web-tree-sitter-sys | |
- uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./target/doc | |
force_orphan: true | |
if: github.event_name == 'push' && github.ref == 'refs/heads/main' | |
# verify that code is formatted | |
cargo-fmt: | |
name: Run cargo fmt | |
needs: [skip-commit] | |
runs-on: ubuntu-latest | |
env: | |
RUST_TOOLCHAIN: nightly | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
profile: minimal | |
override: true | |
components: rustfmt | |
- name: Run cargo fmt | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: ${{ env.RUST_TOOLCHAIN }} | |
command: fmt | |
args: --all -- --check | |
# verify that tests pass | |
cargo-test: | |
name: Run cargo test | |
needs: [skip-commit] | |
runs-on: ubuntu-latest | |
env: | |
WASM_BINDGEN_CLI_VERSION: "0.2.83" | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
profile: minimal | |
- run: rustup target add wasm32-unknown-unknown | |
- name: Cache wasm-bindgen-cli/bin | |
id: cache-wasm-bindgen-cli | |
uses: actions/cache@v1 | |
with: | |
path: ${{ runner.tool_cache }}/wasm-bindgen-cli/bin | |
key: wasm-bindgen-cli-bin-${{ env.WASM_BINDGEN_CLI_VERSION }} | |
- name: Install wasm-bindgen-cli | |
if: "steps.cache-wasm-bindgen-cli.outputs.cache-hit != 'true'" | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: --root ${{ runner.tool_cache }}/wasm-bindgen-cli --force wasm-bindgen-cli --version ${{ env.WASM_BINDGEN_CLI_VERSION }} | |
- name: Configure $PATH for wasm-bindgen-cli | |
run: echo "${{ runner.tool_cache }}/wasm-bindgen-cli/bin" >> $GITHUB_PATH | |
- name: Install node dependencies | |
run: npm ci | |
- name: Run cargo xtask test | |
uses: actions-rs/cargo@v1 | |
with: | |
command: xtask | |
args: test -- --target wasm32-unknown-unknown | |