This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ci): add conditions to workflow runs (#2459)
Some PRs make changes to only specific parts of the repo and do not require all checks to run on unmodified parts. This PR adds conditions to workflow runs to save time and resources. Example: #2457 only modified `.md` files but the ci still reformatted all files and tried to deploy playground (and failed without reasons). Reference used for this PR: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#example-including-paths. Also renamed jobs with clearer titles to avoid confusion (cherry pick if not wanted).
- Loading branch information
Showing
6 changed files
with
55 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,14 +5,21 @@ on: | |
pull_request: | ||
branches: | ||
- main | ||
paths: # Only run when changes are made to rust code or root Cargo | ||
- 'crates/**' | ||
- 'xtask/**' | ||
- 'Cargo.toml' | ||
- 'Cargo.lock' | ||
- 'rust-toolchain.toml' | ||
- 'rustfmt.toml' | ||
|
||
env: | ||
RUST_LOG: info | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
format: | ||
name: format | ||
name: Format Rust Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
|
@@ -26,24 +33,9 @@ jobs: | |
with: | ||
command: fmt | ||
args: --all --verbose -- --check | ||
format-js: | ||
name: Format JS Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Rome | ||
uses: rome/[email protected] | ||
with: | ||
version: preview | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Run Rome Format | ||
run: rome format --ci editors website | ||
|
||
|
||
lint: | ||
name: lint | ||
name: Lint Rust Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout PR Branch | ||
|
@@ -66,7 +58,7 @@ jobs: | |
args: --workspace --all-targets --verbose -- --deny warnings | ||
|
||
test: | ||
name: test | ||
name: Test | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
|
||
# Jobs run on pull request in js folders | ||
name: Pull request JS | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: # Only run when changes are made to js code | ||
- 'website/**' | ||
- 'editors/**' | ||
|
||
env: | ||
RUST_LOG: info | ||
RUST_BACKTRACE: 1 | ||
|
||
jobs: | ||
format-js: | ||
name: Format JS Files | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Install Rome | ||
uses: rome/[email protected] | ||
with: | ||
version: preview | ||
|
||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Run Rome Format | ||
run: rome format --ci editors website |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters