-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (50 loc) · 1.88 KB
/
ci-update-sccache.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
name: ci-update-sccache
on:
push:
branches: [main, master, release-*, gha-test-*]
defaults:
run:
shell: bash
env:
max_threads: 16
pre_command: cd /opt/git/diem/
jobs:
update-sccache-osx:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
# This ensures that the tip of the PR is checked out instead of the merge between the base ref and the tip
# On `push` this value will be empty and will "do-the-right-thing"
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0 #get all the history!!!
- id: changes
name: determine changes
uses: ./.github/actions/changes
with:
workflow-file: ci-update-sccache.yml
- id: rust-changes
name: find rust/cargo changes.
uses: ./.github/actions/matches
with:
pattern: '^documentation\|^docker\|^scripts\|^.circleci'
invert: "true"
- uses: ./.github/actions/build-setup
if: ${{ steps.rust-changes.outputs.changes-found == 'true' }}
- uses: actions/cache@v2
if: ${{ steps.rust-changes.outputs.changes-found == 'true' }}
with:
path: "/opt/cargo/git\n/opt/cargo/registry\n/opt/cargo/.package-cache"
key: crates-${{ runner.os }}-${{ hashFiles('Cargo.lock') }}
restore-keys: "crates-${{ runner.os }}"
- name: build all unit test code.
if: ${{ steps.rust-changes.outputs.changes-found == 'true' }}
run: |
$pre_command && cargo x test --no-run --jobs ${max_threads} --unit
echo stats:
sccache -s
env:
SCCACHE_AWS_ACCESS_KEY_ID: ${{ secrets.SCCACHE_AWS_ACCESS_KEY_ID }}
SCCACHE_AWS_SECRET_ACCESS_KEY: ${{ secrets.SCCACHE_AWS_SECRET_ACCESS_KEY }}
- uses: ./.github/actions/build-teardown
if: ${{ steps.rust-changes.outputs.changes-found == 'true' }}