forked from MystenLabs/sui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: use shared action for detecting changes
* also updated actions/checkout to v3
- Loading branch information
1 parent
0dae398
commit 22246cc
Showing
6 changed files
with
47 additions
and
40 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Detect Changes | ||
description: Defines variables indicating the parts of the code that changed | ||
outputs: | ||
isRust: | ||
description: True when changes happened to the rust code | ||
value: "${{ steps.diff.outputs.isRust }}" | ||
isExplorerClient: | ||
description: True when there are changes to files related to explorer client | ||
value: "${{ steps.diff.outputs.isExplorerClient }}" | ||
runs: | ||
using: composite | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
id: diff | ||
with: | ||
filters: | | ||
isRust: | ||
- '!(explorer|doc|.github)/**' | ||
- '.github/workflows/bench.yml' | ||
- '.github/workflows/codecov.yml' | ||
- '.github/workflows/rust.yml' | ||
isExplorerClient: | ||
- 'explorer/client/**' | ||
- '.github/workflows/explorer-client-prs.yml' |
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 |
---|---|---|
|
@@ -32,21 +32,17 @@ jobs: | |
outputs: | ||
isRust: ${{ steps.diff.outputs.isRust }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
uses: './.github/actions/diffs' | ||
id: diff | ||
with: | ||
filters: | | ||
isRust: | ||
- '!(explorer|doc|.github)/**' | ||
- '.github/workflows/bench.yml' | ||
|
||
bench: | ||
needs: diff | ||
if: github.event.pull_request.draft == false && needs.diff.outputs.isRust == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
# Enable caching of the 'librocksdb-sys' crate by additionally caching the | ||
# 'librocksdb-sys' src directory which is managed by cargo | ||
|
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 |
---|---|---|
|
@@ -14,15 +14,10 @@ jobs: | |
outputs: | ||
isRust: ${{ steps.diff.outputs.isRust }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
uses: './.github/actions/diffs' | ||
id: diff | ||
with: | ||
filters: | | ||
isRust: | ||
- '!(explorer|doc|.github)/**' | ||
- '.github/workflows/bench.yml' | ||
|
||
codecov-grcov: | ||
name: Generate code coverage | ||
|
@@ -32,7 +27,7 @@ jobs: | |
strategy: | ||
fail-fast: true | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
components: llvm-tools-preview | ||
|
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 |
---|---|---|
|
@@ -4,25 +4,20 @@ jobs: | |
diff: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
isClient: ${{ steps.diff.outputs.isClient }} | ||
isClient: ${{ steps.diff.outputs.isExplorerClient }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
uses: './.github/actions/diffs' | ||
id: diff | ||
with: | ||
filters: | | ||
isClient: | ||
- 'explorer/client/**' | ||
- '.github/workflows/explorer-client-prs.yml' | ||
client_checks: | ||
name: Lint, Test & Build | ||
needs: diff | ||
if: needs.diff.outputs.isClient == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
- name: Install Nodejs | ||
uses: actions/setup-node@v2 | ||
with: | ||
|
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 |
---|---|---|
|
@@ -34,21 +34,16 @@ jobs: | |
outputs: | ||
isRust: ${{ steps.diff.outputs.isRust }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- name: Detect Changes | ||
uses: dorny/[email protected] | ||
uses: './.github/actions/diffs' | ||
id: diff | ||
with: | ||
filters: | | ||
isRust: | ||
- '!(explorer|doc|.github)/**' | ||
- '.github/workflows/rust.yml' | ||
|
||
license-check: | ||
name: license-check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- run: scripts/license_check.sh | ||
|
||
test: | ||
|
@@ -58,7 +53,7 @@ jobs: | |
strategy: | ||
fail-fast: false | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
# Enable caching of the 'librocksdb-sys' crate by additionally caching the | ||
# 'librocksdb-sys' src directory which is managed by cargo | ||
|
@@ -76,7 +71,7 @@ jobs: | |
if: needs.diff.outputs.isRust == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
components: clippy | ||
|
@@ -94,7 +89,7 @@ jobs: | |
if: needs.diff.outputs.isRust == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
with: | ||
components: rustfmt | ||
|
@@ -110,15 +105,15 @@ jobs: | |
if: needs.diff.outputs.isRust == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: EmbarkStudios/cargo-deny-action@v1 | ||
|
||
cargo-udeps: | ||
needs: diff | ||
if: needs.diff.outputs.isRust == 'true' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/checkout@v3 | ||
- uses: actions-rs/toolchain@v1 | ||
# Enable caching of the 'librocksdb-sys' crate by additionally caching the | ||
# 'librocksdb-sys' src directory which is managed by cargo | ||
|