Skip to content

Commit 03e41d6

Browse files
committed
INFRA-957: added cache to ci
1 parent 414c568 commit 03e41d6

File tree

1 file changed

+34
-2
lines changed

1 file changed

+34
-2
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
name: Build & test
22
on: [push]
33
env:
4-
BAZEL_ARGS: --repository_cache=~/repo-cache --disk_cache=~/disk-cache
4+
BAZEL_REPO_CACHE: ~/repo-cache
5+
BAZEL_DISK_CACHE: ~/disk-cache
6+
BAZEL_ARGS: --repository_cache=$BAZEL_REPO_CACHE --disk_cache=$BAZEL_DISK_CACHE
57
HADOOP_VERSION: 2.10.1
68
SPARK_VERSION: 2.4.8
79
SFL4J_VERSION: 1.7.30
@@ -19,7 +21,37 @@ jobs:
1921
with:
2022
nix_path: nixpkgs=./nixpkgs.nix
2123

22-
- run: echo "build --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs" > .bazelrc.local
24+
- name: Configure
25+
run: |
26+
mkdir -p ~/repo-cache ~/disk-cache
27+
echo "build --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs" > .bazelrc.local
28+
29+
- name: Mount Bazel cache
30+
uses: actions/cache/restore@v3
31+
if: github.ref != 'refs/heads/master'
32+
id: restore-cache
33+
with:
34+
path: |
35+
~/repo-cache
36+
~/disk-cache
37+
key: repo-cache-${{ runner.os }}-haskell-nixpkgs-${{ env.cache-version }}-${{ github.run_id }}-${{ github.run_attempt }}
38+
restore-keys: |
39+
repo-cache-${{ runner.os }}-haskell-nixpkgs-${{ env.cache-version }}-
40+
41+
# - name: Save Bazel cache
42+
# uses: actions/cache/save@v3
43+
# id: save-cache
44+
# with:
45+
# path: |
46+
# ~/repo-cache
47+
# ~/disk-cache
48+
# key: repo-cache-${{ runner.os }}-haskell-nixpkgs-${{ env.cache-version }}-${{ github.run_id }}-${{ github.run_attempt }}
49+
# # Remove leading and trailing whitespaces
50+
# invalidate-output-patterns: |
51+
# (?i)^\s*.*$
52+
53+
54+
# - run: echo "build --host_platform=@rules_haskell//haskell/platforms:linux_x86_64_nixpkgs" > .bazelrc.local
2355
- run: nix-shell --pure --run 'bazel build //apps/hello:sparkle-example-hello_deploy.jar'
2456
- run: nix-shell --pure --run 'bazel build //apps/rdd-ops:sparkle-example-rddops_deploy.jar'
2557
- run: nix-shell --pure --run 'bazel build //apps/dataframe:sparkle-example-dataframe_deploy.jar'

0 commit comments

Comments
 (0)