Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve issue#2165 - GitHub Action: Improve caching build CLI tool #2170

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 28 additions & 26 deletions .github/workflows/lint_master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,25 @@ jobs:
with:
toolchain: stable
override: true
- name: Cache Rust dependencies and CLI tool
id: cache-cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
cache-targets: true
cache-all-crates: "true"
workspaces: cli
- name: Install cargo-binstall
uses: cargo-bins/cargo[email protected]
- name: set sccache env var
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install nj-cli
run: cargo install nj-cli
run: cargo binstall nj-cli
- name: enable corepack for yarnpkg upgrade
run: corepack enable
- name: Install Build CLI tool
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: |
echo ${{steps.cache-cargo.outputs}}
cargo install --path=cli
run: cargo install --path=cli --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: install wasm-pack
run: cargo install wasm-pack
run: cargo binstall wasm-pack
- name: JS/TS linting
timeout-minutes: 30
run: cargo chipmunk lint -u immediate
Expand Down Expand Up @@ -74,25 +74,27 @@ jobs:
with:
toolchain: stable
override: true
- name: Cache Rust dependencies and CLI tool
id: cache-cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
cache-targets: true
cache-all-crates: "true"
workspaces: cli
- name: Install cargo-binstall
uses: cargo-bins/cargo[email protected]
- name: set sccache env var
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install nj-cli
run: cargo install nj-cli
run: cargo binstall nj-cli
- name: enable corepack for yarnpkg upgrade
run: |
npm install tslib
corepack enable
- name: Install Build CLI tool
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install --path=cli
run: cargo install --path=cli --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: install wasm-pack
run: cargo install wasm-pack
run: cargo binstall wasm-pack
- name: Execute tests
timeout-minutes: 30
env:
Expand Down
52 changes: 28 additions & 24 deletions .github/workflows/pullrequest_check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,23 +30,25 @@ jobs:
with:
toolchain: stable
override: true
- name: Cache Rust dependencies and CLI tool
id: cache-cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
cache-targets: true
cache-all-crates: "true"
workspaces: cli
- name: Install cargo-binstall
uses: cargo-bins/cargo[email protected]
- name: set sccache env var
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install nj-cli
run: cargo install nj-cli
run: cargo binstall nj-cli
- name: enable corepack for yarnpkg upgrade
run: corepack enable
- name: Install Build CLI tool
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install --path=cli
run: cargo install --path=cli --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: install wasm-pack
run: cargo install wasm-pack
run: cargo binstall wasm-pack
- name: JS/TS linting
timeout-minutes: 30
run: cargo chipmunk lint -u immediate
Expand Down Expand Up @@ -79,25 +81,27 @@ jobs:
with:
toolchain: stable
override: true
- name: Cache Rust dependencies and CLI tool
id: cache-cargo
uses: Swatinem/rust-cache@v2
with:
key: ${{ runner.os }}-cargo-${{ hashFiles('Cargo.toml', 'Cargo.lock') }}
cache-targets: true
cache-all-crates: "true"
workspaces: cli
- name: Install cargo-binstall
uses: cargo-bins/cargo[email protected]
- name: set sccache env var
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: Install nj-cli
run: cargo install nj-cli
run: cargo binstall nj-cli
- name: enable corepack for yarnpkg upgrade
run: |
npm install tslib
corepack enable
- name: Install Build CLI tool
if: steps.cache-cargo.outputs.cache-hit != 'true'
run: cargo install --path=cli
run: cargo install --path=cli --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: install wasm-pack
run: cargo install wasm-pack
run: cargo binstall wasm-pack
- name: Execute tests
timeout-minutes: 30
env:
Expand Down
21 changes: 15 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,23 @@ jobs:
uses: hecrj/setup-rust-action@v1
with:
rust-version: ${{ matrix.rust }}
- name: Rust Cache
uses: Swatinem/[email protected]
- name: cargo install nj-cli
run: cargo install nj-cli
- name: Install cargo-binstall
uses: cargo-bins/[email protected]
- name: set sccache env var
run: |
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV
- name: Run sccache-cache
uses: mozilla-actions/[email protected]
- name: cargo binstall nj-cli
run: cargo binstall nj-cli
- name: install wasm-pack
run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
run: cargo binstall wasm-pack
- name: Install Build CLI tool
run: cargo install --path=cli
run: cargo install --path=cli --locked
env:
SCCACHE_GHA_ENABLED: "true"
RUSTC_WRAPPER: "sccache"
- name: enable corepack for yarnpkg upgrade
run: |
corepack enable
Expand Down
Loading