2020-07-29 23:04:47 +09:00
|
|
|
name: Lint
|
|
|
|
|
2020-08-17 23:36:09 +09:00
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches: [master, develop]
|
|
|
|
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
|
|
|
|
uses: actions/setup-node@v1
|
|
|
|
with:
|
|
|
|
node-version: 12
|
|
|
|
|
|
|
|
- name: Install
|
|
|
|
uses: actions-rs/toolchain@v1
|
|
|
|
with:
|
|
|
|
toolchain: stable
|
|
|
|
profile: default
|
|
|
|
override: true
|
|
|
|
|
|
|
|
- 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') }}
|
|
|
|
restore-keys: |
|
|
|
|
npm-cache-
|
|
|
|
|
|
|
|
- name: 'Install dependencies'
|
|
|
|
run: yarn install --frozen-lockfile --registry https://registry.npmjs.org
|
|
|
|
|
|
|
|
- name: 'Lint JS/TS'
|
|
|
|
run: yarn lint
|
|
|
|
|
|
|
|
- name: 'Lint rust'
|
|
|
|
run: cargo fmt -- --check
|
|
|
|
|
|
|
|
- name: Clear the cargo caches
|
|
|
|
run: |
|
|
|
|
cargo install cargo-cache --no-default-features --features ci-autoclean
|
|
|
|
cargo-cache
|