perf(workflow) filter workflow with the paths option (#828)

* perf(workflow) run bundler test only when the bundler changes

* perf(workflow) split clippy/eslint/fmt checks

* chore(workflow) rerun if workflow file change

* chore(workflow) fix name

* fix(tests) bundler test on windows, removed since it's not used
This commit is contained in:
Lucas Fernandes Nogueira
2020-07-15 08:14:11 -03:00
committed by GitHub
parent 490b3a3323
commit f1a8a65be2
5 changed files with 92 additions and 43 deletions

View File

@@ -1,10 +1,12 @@
name: clippy, fmt and eslint check
name: clippy and fmt check
on:
push:
branches-ignore:
- latest
- dev
pull_request:
paths:
- .github/workflows/core-lint-fmt.yml
- ./tauri/**
- ./tauri-utils/**
- ./tauri-api/**
jobs:
workspace_clippy_fmt_check:
@@ -25,11 +27,6 @@ jobs:
env:
TAURI_DIST_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/dist
TAURI_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/src-tauri
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./cli/tauri-bundler/Cargo.toml --all-targets -- -D warnings
name: bundler
- uses: actions-rs/toolchain@v1
with:
profile: minimal
@@ -62,15 +59,3 @@ jobs:
env:
TAURI_DIST_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/dist
TAURI_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/src-tauri
eslint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: install deps via yarn
working-directory: ./cli/tauri.js
run: yarn
- name: run eslint
working-directory: ./cli/tauri.js
run: yarn lint

20
.github/workflows/js-lint.yml vendored Normal file
View File

@@ -0,0 +1,20 @@
name: eslint check
on:
pull_request:
paths:
- .github/workflows/js-lint.yml
- ./cli/tauri.js/**
jobs:
eslint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: install deps via yarn
working-directory: ./cli/tauri.js
run: yarn
- name: run eslint
working-directory: ./cli/tauri.js
run: yarn lint

54
.github/workflows/test-bundler.yml vendored Normal file
View File

@@ -0,0 +1,54 @@
name: test bundler
on:
pull_request:
paths:
- .github/workflows/test-bundler.yml
- ./cli/tauri-bundler/**
env:
RUST_BACKTRACE: 1
jobs:
build-tauri-bundler:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: test
run: |
cd ./cli/tauri-bundler
cargo test
clippy-fmt-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup component add clippy
- name: clippy check
uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --manifest-path ./cli/tauri-bundler/Cargo.toml --all-targets -- -D warnings
name: bundler
- name: install rustfmt
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
override: true
components: rustfmt
- name: fmt check
uses: actions-rs/cargo@v1
with:
command: fmt
args: --manifest-path ./cli/tauri-bundler/Cargo.toml --all -- --check

View File

@@ -1,6 +1,14 @@
name: test library
name: test core
on:
pull_request:
paths:
- .github/workflows/test-core.yml
- ./cli/**
- ./tauri/**
- ./tauri-api/**
- ./tauri-utils/**
on: pull_request
env:
RUST_BACKTRACE: 1
@@ -38,25 +46,6 @@ jobs:
TAURI_DIST_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/dist
TAURI_DIR: ${{ runner.workspace }}/tauri/tauri/examples/communication/src-tauri
build-tauri-bundler:
runs-on: ${{ matrix.platform }}
strategy:
fail-fast: false
matrix:
platform: [ubuntu-latest, macos-latest, windows-latest]
steps:
- uses: actions/checkout@v2
- name: install stable
uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: build
run: |
cd ./cli/tauri-bundler
cargo build
test-tauri-js-cli:
runs-on: ${{ matrix.platform }}