-
Notifications
You must be signed in to change notification settings - Fork 207
149 lines (141 loc) · 4.82 KB
/
after-merge.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
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
# Run after merge to trunk
# Note that this relies on branch protection having:
# Require branches to be up to date before merging
on:
push:
branches:
# $default-branch
- master
- release-pismo
jobs:
build:
if: ${{ github.repository_owner == 'agoric' }}
runs-on: ubuntu-latest
strategy:
matrix:
node-version: ['16.x', '18.x']
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version}}
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
dev-canary:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
# Adapted from https://johnny.sh/notes/publish-canary-lerna-cicd/
- name: configure NPM token
run: |
echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: check credentials
run: npm whoami
- name: publish to NPM tag
run: |
if [ "${{ github.ref_name }}" = "release-pismo" ]; then
# A pismo dev release.
TAG=pismo-dev
else
# Just a dev release.
TAG=dev
fi
# without concurrency until https://github.com/Agoric/agoric-sdk/issues/8091
yarn lerna publish --concurrency 1 --conventional-prerelease --canary --exact \
--dist-tag=$TAG --preid=$TAG-$(git rev-parse --short=7 HEAD) \
--no-push --no-verify-access --yes
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
coverage:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
if: ${{github.event_name == 'push' }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
- name: generate coverage for all tests
run: 'yarn test:c8-all || :'
- name: generate coverage/html reports
run: mkdir -p coverage/tmp && yarn c8 report --reporter=html-spa --reports-dir=coverage/html --temp-directory=coverage/tmp
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage
- name: Find Netlify site ID
run: |
echo "NETLIFY_SITE_ID=$(cat COVERAGE_NETLIFY_SITE_ID)" >> $GITHUB_ENV
- uses: nwtgck/actions-netlify@v1.1
with:
# Production deployment if a push or merged PR.
production-deploy: ${{github.event_name == 'push'}}
publish-dir: coverage/html
# SECURITY: we don't want to hand out the Github token to this action.
# github-token: ${{ secrets.GITHUB_TOKEN }}
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}
benchmark:
needs: build
runs-on: ubuntu-latest
strategy:
matrix:
# note: only use one node-version
node-version: ['18.x']
if: ${{github.event_name == 'push'}}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/restore-node
with:
node-version: ${{ matrix.node-version }}
- name: benchmark changes
env:
AUTOBENCH_METRICS_URL: ${{ secrets.AUTOBENCH_METRICS_URL }}
run: cd packages/swingset-runner && yarn ci:autobench
- uses: actions/upload-artifact@v3
with:
name: benchmarkstats.json
path: packages/swingset-runner/benchstats*.json
- name: notify on failure
if: failure()
uses: ./.github/actions/notify-status
with:
from: ${{ secrets.NOTIFY_EMAIL_FROM }}
to: ${{ secrets.NOTIFY_EMAIL_TO }}
password: ${{ secrets.NOTIFY_EMAIL_PASSWORD }}
webhook: ${{ secrets.SLACK_WEBHOOK_URL }}