-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (98 loc) · 2.98 KB
/
pull-request.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
name: Pull Request Checks
on:
pull_request:
types: [opened, reopened, synchronize]
branches:
- main
- staging
jobs:
changes:
name: Check Changes
runs-on: ubuntu-latest
permissions:
pull-requests: read
outputs:
default: ${{ steps.filter.outputs.default }}
app: ${{ steps.filter.outputs.app }}
web: ${{ steps.filter.outputs.web }}
contracts: ${{ steps.filter.outputs.contracts }}
steps:
- uses: dorny/paths-filter@v2
id: filter
with:
filters: |
default:
- .github/workflows/pull-request.yml
- yarn.lock
app:
- .github/workflows/app-*.yml
- packages/app/**
web:
- .github/workflows/web-*.yml
- packages/web/**
contracts:
- .github/workflows/contracts-push.yml
- packages/contracts/**
app-build-test:
needs: changes
name: Build Test for App Service
runs-on: ubuntu-latest
if: |
needs.changes.outputs.default == 'true' ||
needs.changes.outputs.app == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Image
env:
ECR_REPOSITORY: test/app-service
IMAGE_TAG: ${{ github.sha }}
run: |
docker build \
--build-arg INFURA_API_KEY=12345678 \
--build-arg WALLETCONNECT_PROJECT_ID=12345678 \
--build-arg ENABLE_TESTNETS=1 \
--build-arg ENABLE_HARDHAT_NODE=1 \
--build-arg ENABLE_AUTOMATION=1 \
-f packages/app/Dockerfile -t $ECR_REPOSITORY:$IMAGE_TAG .
web-build-test:
needs: changes
name: Build Test for Website Service
runs-on: ubuntu-latest
if: |
needs.changes.outputs.default == 'true' ||
needs.changes.outputs.web == 'true'
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Build Image
env:
ECR_REPOSITORY: test/website-service
IMAGE_TAG: ${{ github.sha }}
run: |
docker build \
--build-arg BASE_URL=http://localhost \
--build-arg UX_FEATURE_DECK_URL=http://localhost/deck \
-f packages/web/Dockerfile -t $ECR_REPOSITORY:$IMAGE_TAG .
contracts-tests:
needs: changes
name: Smart Contracts Tests
runs-on: ubuntu-latest
if: |
needs.changes.outputs.default == 'true' ||
needs.changes.outputs.contracts == 'true'
env:
MNEMONIC: "here are my twelve golden words for you to run the tests"
INFURA_API_KEY: ${{ secrets.INFURA_API_KEY }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
cache: yarn
node-version: 18.x
- name: "Install dependencies"
run: yarn install --frozen-lockfile
- name: "Compile contracts"
run: yarn build:contracts
- name: "Run test coverage"
run: yarn test:contracts:coverage