Skip to content

Commit

Permalink
chore: try caching
Browse files Browse the repository at this point in the history
  • Loading branch information
kayagokalp committed Jun 11, 2023
1 parent d949a19 commit 99038ef
Showing 1 changed file with 30 additions and 2 deletions.
32 changes: 30 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,17 +67,45 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}
components: clippy, rustfmt

- name: Init cache
- name: Init rust cache
uses: Swatinem/rust-cache@v2

- name: Cache nix-cache locally
id: cache-nix
uses: actions/cache@v2.1.0
with:
# See https://stackoverflow.com/questions/59269850.
path: |
~/nix/store
~/nix/bin
# Using number to enforce fresh cache.
key: ${{ runner.os }}-15

- name: Install fuel toolchain
env:
CACHE_HIT: ${{ steps.cache-nix.outputs.cache-hit }}
uses: cachix/install-nix-action@v21
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
extra-substituters = https://fuellabs.cachix.org
extra-trusted-public-keys = fuellabs.cachix.org-1:3gOmll82VDbT7EggylzOVJ6dr0jgPVU/KMN6+Kf8qx8=
- run: nix profile install github:fuellabs/fuel.nix#forc-0-39-0
- run: |
NIX_BIN=/nix/var/nix/profiles/per-user/runner/profile/bin
NIX_STORE=/nix/store
if [[ "$CACHE_HIT" != 'true' ]]; then
nix-env --install --file latex.nix
nix profile install github:fuellabs/fuel.nix#fuel
mkdir -p ~/nix/store
mkdir -p ~/nix/bin
sudo cp --force --recursive $NIX_STORE/* ~/nix/store/
sudo cp --verbose --force --recursive $NIX_BIN/* ~/nix/bin/
else
sudo mkdir -p $NIX_STORE
sudo mkdir -p $NIX_BIN
sudo cp --force --recursive ~/nix/store/* $NIX_STORE/
sudo cp --force --recursive ~/nix/bin/* $NIX_BIN/
fi
- name: Check Sway formatting
run: |
Expand Down

0 comments on commit 99038ef

Please sign in to comment.