Skip to content

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
ngtkana committed Oct 18, 2023
1 parent 77694b7 commit 66edf12
Show file tree
Hide file tree
Showing 2 changed files with 80 additions and 29 deletions.
14 changes: 14 additions & 0 deletions .github/actions/setup-rust/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Setup Rust
description: "Set up your GitHub Actions"

runs:
using: composite
steps:
- name: Rust Toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable

- uses: taiki-e/install-action@nextest

- uses: taiki-e/install-action@cargo-make
95 changes: 66 additions & 29 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,50 +2,87 @@ name: Rust

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

env:
CARGO_TERM_COLOR: always

jobs:
check:
changes:
runs-on: ubuntu-latest
outputs:
trigger: ${{ steps.changes.outputs.triggers }}
steps:
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v1
- name: Run makers check
run: cargo make check
- name: Clone Project
uses: actions/checkout@v4
with:
lfs: false

test:
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
triggers:
- 'rust/**'
- '.github/workflows/rust.yml'
lint:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.trigger == 'true'
steps:
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v1
- name: Run makers test
run: cargo make test
- name: Clone Project
uses: actions/checkout@v4
with:
lfs: false

clippy:
- name: Setup Rust
uses: ./.github/actions/setup-rust

- name: Clippy
working-directory: .
run: cargo make clippy

doctest:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.trigger == 'true'
steps:
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v1
- name: Run makers clippy
run: cargo make clippy
- name: Clone Project
uses: actions/checkout@v4
with:
lfs: false

- name: Setup Rust
uses: ./.github/actions/setup-rust

- name: Doctest
working-directory: .
run: cargo make test-doc

docs:
runs-on: ubuntu-latest
timeout-minutes: 20
needs: changes
if: needs.changes.outputs.trigger == 'true'
steps:
- uses: davidB/rust-cargo-make@v1
- uses: actions/checkout@v1
- name: Run makers docs
run: cargo make docs
- name: Check that crates.js is surely copied
run: test -e target/doc/crates.js
- name: Deploy GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc
- name: Clone Project
uses: actions/checkout@v4
with:
lfs: false

- name: Setup Rust
uses: ./.github/actions/setup-rust
- uses: davidB/rust-cargo-make@v1

- name: Run makers docs
run: cargo make docs

- name: Check that crates.js is surely copied
run: test -e target/doc/crates.js

- name: Deploy GitHub Pages
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: target/doc

0 comments on commit 66edf12

Please sign in to comment.