-
Notifications
You must be signed in to change notification settings - Fork 0
105 lines (91 loc) · 3.5 KB
/
ci.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
name: General CI
on:
push:
branches:
- dev
paths-ignore:
- '**/README.md'
pull_request:
branches:
- dev
types:
- opened
- reopened
- synchronize
- ready_for_review
jobs:
set-env:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set Node version
uses: actions/setup-node@v4
with:
node-version: 18
fmt:
runs-on: ubuntu-latest
needs:
- set-env
steps:
- uses: actions/checkout@v4
- name: Fmt check
run: |
corepack enable && corepack enable pnpm && pnpm install --frozen-lockfile
pnpm run check-format
contracts-uint-tests:
runs-on: ubuntu-latest
needs:
- set-env
steps:
- uses: actions/checkout@v4
- name: Install deps
run: |
npm install --save-dev hardhat
- name: Run contracts unit tests
run: |
npx hardhat test
- name: Run contracts unit tests
run: |
npx hardhat test
integration-tests:
runs-on: ubuntu-latest
needs:
- contracts-uint-tests
steps:
- uses: actions/checkout@v4
- name: Pull litentry image optionally
run: |
docker pull litentry/identity-worker:latest
docker pull litentry/identity-cli:latest
docker pull litentry/litentry-chain-aio:latest
- name: Create env file with secrets
run: |
mkdir -p /opt/worker_configs
echo "TWITTER_AUTH_TOKEN_V2=${{ secrets.TWITTER_AUTH_TOKEN_V2 }}" >> /opt/worker_configs/worker_env
echo "DISCORD_AUTH_TOKEN=${{ secrets.DISCORD_AUTH_TOKEN }}" >> /opt/worker_configs/worker_env
echo "ACHAINABLE_AUTH_KEY=${{ secrets.ACHAINABLE_AUTH_KEY }}" >> /opt/worker_configs/worker_env
echo "ONEBLOCK_NOTION_KEY=${{ secrets.ONEBLOCK_NOTION_KEY }}" >> /opt/worker_configs/worker_env
echo "NODEREAL_API_KEY=${{ secrets.NODEREAL_API_KEY }}" >> /opt/worker_configs/worker_env
echo "GENIIDATA_API_KEY=${{ secrets.GENIIDATA_API_KEY }}" >> /opt/worker_configs/worker_env
echo "MORALIS_API_KEY=${{ secrets.MORALIS_API_KEY }}" >> /opt/worker_configs/worker_env
echo "MAGIC_CRAFT_API_KEY=${{ secrets.MAGIC_CRAFT_API_KEY }}" >> /opt/worker_configs/worker_env
- name: Compile contracts
run: |
npm install --save-dev hardhat
npx hardhat compile
- name: Run integration tests
working-directory: ./vc-di-tests/integration-tests
run: |
corepack enable && corepack enable pnpm && pnpm install --no-frozen-lockfile
pnpm run test assertion_contracts.test.ts
- name: Stop docker
run: |
docker rm -f $(docker ps -aq)
- name: Upload docker logs if test fails
uses: actions/upload-artifact@v4
if: failure()
with:
name: integration-tests-docker-logs
path: docker-logs
if-no-files-found: ignore
retention-days: 3