-
Notifications
You must be signed in to change notification settings - Fork 3
90 lines (73 loc) · 2.1 KB
/
cache-xml.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Populate Grid cache
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
slack-channel: 'alerts'
concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
populate_grid_cache:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Display envvars
run: env
- name: Download XSD
run: |
docker run \
--rm \
-v $(pwd)/cache:/var/cache/grid \
hyperledger/gridd:nightly \
grid download-xsd
- name: Create checksum file
run: find cache -type f | xargs shasum -a 256 > checksums.sha
- name: Display checksums
run: cat checksums.sha && echo "XML_CACHE_HASH - ${{ hashFiles('checksums.sha') }}"
- name: Add files to the cache
uses: actions/cache@v2
with:
path: cache/
key: xml-${{ hashFiles('checksums.sha') }}
restore-keys:
xml-
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
test_cache_restore:
runs-on: ubuntu-latest
needs: populate_grid_cache
steps:
- uses: actions/checkout@v2
- name: Display envvars
run: env
- name: Retrieve from cache
uses: actions/cache@v2
with:
path: cache/
key: xml-${{ secrets.XML_CACHE_HASH }}
- name: Show cache
run: ls -al -R cache/
- name: Verify unpack
run: |
docker run \
--rm \
-v $(pwd)/cache:/var/cache/grid/ \
hyperledger/gridd:nightly \
grid download-xsd --no-download
- name: Notify Slack of Failure
if: failure()
uses: 8398a7/action-slack@v3
with:
status: ${{ job.status }}
fields: repo,message,author,job
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}