From ec67abe1eff0fb0f75210def82739e2f74196b91 Mon Sep 17 00:00:00 2001 From: Yota Toyama Date: Sat, 20 May 2023 20:08:06 -0700 Subject: [PATCH] Update CI (#254) --- .cspell.json | 11 ++++++++ .github/dependabot.yml | 4 +++ .mergify.yml => .github/mergify.yml | 6 ++++- .github/workflows/lint.yaml | 34 +++++++++++++++++++++++ .github/workflows/test.yaml | 42 +++++++++++++++++------------ 5 files changed, 79 insertions(+), 18 deletions(-) create mode 100644 .cspell.json rename .mergify.yml => .github/mergify.yml (59%) create mode 100644 .github/workflows/lint.yaml diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 0000000..ddedd2a --- /dev/null +++ b/.cspell.json @@ -0,0 +1,11 @@ +{ + "words": [ + "dealloc", + "finalizer", + "gcollect", + "libc", + "realloc", + "repr", + "stackbottom" + ] +} diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 1efcc82..14ab755 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,9 @@ version: 2 updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily - package-ecosystem: cargo directory: / schedule: diff --git a/.mergify.yml b/.github/mergify.yml similarity index 59% rename from .mergify.yml rename to .github/mergify.yml index 94aa865..3063031 100644 --- a/.mergify.yml +++ b/.github/mergify.yml @@ -3,5 +3,9 @@ pull_request_rules: conditions: - author=dependabot[bot] actions: - merge: + queue: + name: default method: squash +queue_rules: + - name: default + conditions: [] diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml new file mode 100644 index 0000000..0b74a59 --- /dev/null +++ b/.github/workflows/lint.yaml @@ -0,0 +1,34 @@ +name: lint +on: + push: + branches: + - main + pull_request: +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: Swatinem/rust-cache@v2 + - run: cargo clippy -- -D warnings + format: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - run: cargo fmt -- --check + spell-check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: streetsidesoftware/cspell-action@main + with: + files: "**/*.{md,rs}" + readme: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: lycheeverse/lychee-action@v1 + with: + fail: true diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 2783947..88085fc 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -5,29 +5,37 @@ on: - main pull_request: jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: Swatinem/rust-cache@v2 + - run: cargo build test: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: submodules: true - - uses: actions-rs/toolchain@v1 - - uses: actions-rs/cargo@v1 + - uses: Swatinem/rust-cache@v2 + - run: cargo test + examples: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 with: - command: build - - uses: actions-rs/cargo@v1 - with: - command: fmt - args: -- --check - - uses: actions-rs/cargo@v1 - with: - command: clippy - - uses: actions-rs/audit-check@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} + submodules: true + - uses: Swatinem/rust-cache@v2 - run: | cd examples ./test.sh - - run: | - git clean -dfx - cargo build --no-default-features --features cmake + cmake: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + with: + submodules: true + - uses: Swatinem/rust-cache@v2 + - run: cargo build --no-default-features --features cmake