-
-
Notifications
You must be signed in to change notification settings - Fork 257
74 lines (66 loc) · 2.28 KB
/
_networks.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
name: Check networks package
on:
workflow_call:
jobs:
coverage:
name: Run checks for the networks package
runs-on: ubuntu-24.04
env:
DOCKER_BUILDKIT: 1
BUILDKIT_PROGRESS: plain
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v45
with:
files: |
packages/networks/src/networks/**
# setup monorepo only if a file has changed
- uses: actions/setup-node@v4
if: steps.changed-files.outputs.any_changed == 'true'
with:
node-version: 20
- run: yarn
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash
- run: yarn build
if: steps.changed-files.outputs.any_changed == 'true'
shell: bash
- name: List all changed files
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo ${ALL_CHANGED_FILES}
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
- name: Validate networks
id: validate
if: steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
yarn workspace @unlock-protocol/networks validate 1> results.txt
shell: bash
- name: Log Results
id: log-results
if: always() && steps.changed-files.outputs.any_changed == 'true'
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
cat results.txt
shell: bash
- name: Add PR Comment
if: ${{ always() && steps.changed-files.outputs.any_changed == 'true' }}
uses: mshick/[email protected]
with:
message-path: results.txt
message-id: networks-check
refresh-message-position: true
# We rely on a deployment of a proxy service to post comment from forked PRs
# see https://github.com/mshick/add-pr-comment-proxy for more info
proxy-url: 'https://pr-comment-bot-79b971aa34fe.herokuapp.com/'