napi-rs/.github/workflows/lint.yaml

70 lines
1.6 KiB
YAML
Raw Normal View History

2020-07-29 23:04:47 +09:00
name: Lint
2020-08-17 23:36:09 +09:00
on:
push:
2020-12-03 17:30:14 +09:00
branches:
- main
2020-08-17 23:36:09 +09:00
pull_request:
2020-07-29 23:04:47 +09:00
jobs:
lint:
name: Lint SourceCode
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup node
2021-01-06 00:53:23 +09:00
uses: actions/setup-node@v2
2020-07-29 23:04:47 +09:00
with:
2020-11-10 12:09:25 +09:00
node-version: 14
check-latest: true
2020-07-29 23:04:47 +09:00
- name: Install
uses: actions-rs/toolchain@v1
with:
toolchain: stable
profile: default
override: true
2020-12-01 15:55:19 +09:00
components: rustfmt, clippy
2020-07-29 23:04:47 +09:00
- name: Generate Cargo.lock
uses: actions-rs/cargo@v1
with:
command: generate-lockfile
- name: Cache cargo registry
uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: lint-cargo-registry-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache cargo index
uses: actions/cache@v1
with:
path: ~/.cargo/git
key: lint-cargo-index-trimmed-${{ hashFiles('**/Cargo.lock') }}
- name: Cache NPM dependencies
uses: actions/cache@v1
with:
path: node_modules
key: lint-${{ hashFiles('yarn.lock') }}
- name: 'Install dependencies'
2020-12-09 12:03:59 +09:00
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org --network-timeout 300000
2020-07-29 23:04:47 +09:00
- name: 'Lint JS/TS'
run: yarn lint
2020-12-01 15:55:19 +09:00
- name: Cargo fmt
2020-07-29 23:04:47 +09:00
run: cargo fmt -- --check
2020-12-01 15:55:19 +09:00
- name: Clippy
run: cargo clippy
2020-07-29 23:04:47 +09:00
- name: Clear the cargo caches
run: |
cargo install cargo-cache --no-default-features --features ci-autoclean
cargo-cache