This repository was archived by the owner on Mar 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 17
57 lines (51 loc) · 1.88 KB
/
unit-tests.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
name: Unit Tests
on:
push:
branches:
- main
- develop
pull_request:
workflow_dispatch:
env:
# Environment variables propagated to godwoken-kicker
MANUAL_BUILD_WEB3: "true"
MANUAL_BUILD_WEB3_INDEXER: "true"
WEB3_GIT_URL: "https://github.com/${{ github.repository }}"
WEB3_GIT_CHECKOUT: "${{ github.sha }}"
jobs:
unit-tests:
runs-on: ubuntu-latest
steps:
# Godwoken-Kicker
- uses: actions/checkout@v3
with:
repository: godwokenrises/godwoken-kicker
ref: 'develop'
- name: Kicker init
run: ./kicker init
- name: Kicker start
run: |
# Temporary workaround unreliable web3 health check
(echo " == kicker start attempt: 1 == " && ./kicker start) || \
(echo " == kicker start attempt: 2 == " && ./kicker stop && ./kicker start) || \
(echo " == kicker start failed == " && docker-compose --file docker/docker-compose.yml logs --tail 6 && exit 1)
docker-compose --file docker/docker-compose.yml logs --tail 6
# FIXME: Sometimes, Godwoken service is not running
# https://github.com/Flouse/godwoken/runs/3639382192?check_suite_focus=true#step:8:667
- name: Kicker ps
run: sleep 60 && ./kicker ps && ./kicker logs web3
- name: Store kicker network information as environment variables
run: |
cat docker/layer2/config/web3-config.env | grep -v '^#' >> $GITHUB_ENV
echo "DATABASE_URL=postgres://user:[email protected]:5432/lumos" >> $GITHUB_ENV
echo "REDIS_URL=redis://127.0.0.1:6379" >> $GITHUB_ENV
# Godwoken-Web3
- uses: actions/checkout@v3
with:
path: godwoken-web3
- name: Yarn run test
working-directory: godwoken-web3
run: yarn && yarn run build && yarn run test
- name: Kicker logs if failure
if: ${{ failure() }}
run: ./kicker ps && ./kicker logs