-
Notifications
You must be signed in to change notification settings - Fork 3
185 lines (149 loc) · 4.74 KB
/
0-8-cron.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
name: 0-8 Cron
on:
schedule:
- cron: "0 7 * * *"
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
slack-channel: 'alerts'
concurrency:
group: "${{ github.ref }}-${{ github.workflow }}"
cancel-in-progress: true
jobs:
update_status:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 0-8
- name: get SHA
run: echo "SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV
- name: Update commit status to pending
run: |
env
curl \
-X POST \
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/${{ github.repository }}/statuses/${{ env.SHA }} \
-d '{"state": "pending", "context": "Cron"}'
lint_sabre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Run Lint/Clippy on Sabre
run: just ci-lint
- 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 }}
unit_test_sabre:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Unit Test Sabre
run: just ci-test
- 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 }}
integration_tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Run Integration Tests
run: just integration-test
- 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 }}
build_docker:
runs-on: ubuntu-latest
if: >-
github.repository_owner == 'hyperledger'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
ref: 0-8
- name: Display envvars
run: env
- name: Install Just
run: curl --proto '=https' --tlsv1.2 -sSf https://just.systems/install.sh | sudo bash -s -- --to /usr/local/bin
- name: Test Docker Build
run: just docker-build
- name: Copy Artifacts
run: docker-compose -f docker/compose/copy-artifacts.yaml up
- name: Archive Artifacts
run: zip -r sabre.zip build/*
- uses: actions/upload-artifact@v2
with:
name: sabre
path: sabre.zip
- 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 }}
publish_artifacts:
needs: [lint_sabre, unit_test_sabre, integration_tests, build_docker]
if: >-
github.repository_owner == 'hyperledger'
runs-on: ubuntu-latest
steps:
- name: Display envvars
run: env
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- uses: actions/download-artifact@v2
with:
name: sabre
- name: Upload Artifacts To S3
run: |
aws s3 cp ./sabre.zip s3://${{ secrets.AWS_S3_BUCKET }}/sawtooth-sabre/0-8/
- 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 }}