This repository has been archived by the owner on Feb 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
155 lines (132 loc) · 4.77 KB
/
test.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
150
151
152
153
154
155
name: Run tests
on:
push:
branches:
- master
pull_request:
env:
JAVA_VERSION: 8
NODE_VERSION: 12
PYTHON_VERSION: 2.7
jobs:
ethereum-env-test:
name: ${{ matrix.working-directory }}
runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [atomic-swap-ethereum-env, minimal-ethereum-env]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ${{ matrix.working-directory }}
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/yarn.lock', matrix.working-directory)) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
working-directory: ${{ matrix.working-directory }}
- name: Run tests
run: yarn test
working-directory: ${{ matrix.working-directory }}
cross-chain-atomic-swap-cordapp:
runs-on: ubuntu-latest
env:
working-directory: cross-chain-atomic-swap-cordapp
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: jdk
- name: cache gradle wrapper
uses: actions/cache@v1
env:
cache-name: gradle-wrapper
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('{0}/gradle/wrapper/gradle-wrapper.properties', env.working-directory)) }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: cache dependencies
uses: actions/cache@v1
env:
cache-name: gradle-caches
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('{0}/build.gradle', env.working-directory)) }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: gradlew test
run: cd ${{ env.working-directory }} && ./gradlew test
flow-test-with-ethereum-env:
name: ${{ matrix.working-directory }}
runs-on: ubuntu-latest
strategy:
matrix:
working-directory: [custom-notary-flow, flow-ethereum-tx]
# TODO https://github.com/LayerXcom/cordage/issues/33 が解決したら flow-ethereum-event-watchを戻す
# working-directory: [custom-notary-flow, flow-ethereum-event-watch, flow-ethereum-tx]
env:
ethereum-directory: minimal-ethereum-env
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/setup-python@v2
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-java@v1
with:
java-version: ${{ env.JAVA_VERSION }}
java-package: jdk
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "::set-output name=dir::$(yarn cache dir)"
working-directory: ${{ env.ethereum-directory }}
- uses: actions/cache@v2
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles(format('{0}/yarn.lock', env.ethereum-directory)) }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Install dependencies
run: yarn
working-directory: ${{ env.ethereum-directory }}
- name: cache gradle wrapper
uses: actions/cache@v1
env:
cache-name: gradle-wrapper
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('{0}/gradle/wrapper/gradle-wrapper.properties', matrix.working-directory)) }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: cache dependencies
uses: actions/cache@v1
env:
cache-name: gradle-caches
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles(format('{0}/build.gradle', matrix.working-directory)) }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
- name: gradlew test
run: |
cd ${{ env.ethereum-directory }}
yarn network &
# TODO https://github.com/LayerXcom/cordage/issues/33 が解決したら 以下コメントを外す
# yarn truffle migrate --network local
cd ../${{ matrix.working-directory }}
./gradlew test