-
Notifications
You must be signed in to change notification settings - Fork 135
53 lines (48 loc) · 1.78 KB
/
demo-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
name: "Demo: Test"
on:
push:
branches: [ main ]
paths:
- '.github/workflows/demo-**'
- 'demo/**'
pull_request:
branches: [ main ]
paths:
- 'demo/**'
- '.github/workflows/demo-**'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
name: "Demo: Test"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: |
pushd demo
# We no longer push Docker images because we deleted some Azure resources, so mcr.microsoft.com might stop working.
docker pull mcr.microsoft.com/samples/blockchain-ai/0xdeca10b-demo:latest
docker build -f Dockerfile \
--cache-from mcr.microsoft.com/samples/blockchain-ai/0xdeca10b-demo:latest \
-t mcr.microsoft.com/samples/blockchain-ai/0xdeca10b-demo:latest \
.
- name: Test
run: |
docker run --rm --name decai-demo \
-v /${PWD}/demo:/root/workspace/demo \
-v /root/workspace/demo/node_modules \
-v /root/workspace/demo/client/node_modules \
mcr.microsoft.com/samples/blockchain-ai/0xdeca10b-demo:latest \
/bin/bash -c "./setup_libs.sh && yarn clean && yarn test"
- name: Lint
run: |
# Split lint into a separate task so that it can always run even if the test fails.
docker run --rm --name decai-demo \
-v /${PWD}/demo:/root/workspace/demo \
-v /root/workspace/demo/node_modules \
-v /root/workspace/demo/client/node_modules \
mcr.microsoft.com/samples/blockchain-ai/0xdeca10b-demo:latest \
/bin/bash -c "yarn lint"
# Run even if the previous step fails.
if: success() || failure()