-
Notifications
You must be signed in to change notification settings - Fork 0
153 lines (134 loc) · 4.4 KB
/
test-examples.yaml
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
name: Test
on:
pull_request:
jobs:
test-edge-native-base:
name: Native Base Image
runs-on: ubuntu-latest
env:
SHELL: /bin/bash
INSTALLED_EDM_VERSION: "3.4.0"
HATCHER_TOKEN: ${{ secrets.HATCHER_TOKEN }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup NodeJS 16.x
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: |
**/package-lock.json
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
id: buildx
with:
install: true
- name: Set up EDM
uses: enthought/setup-edm-action@v2
with:
edm-version: ${{ env.INSTALLED_EDM_VERSION }}
- name: Bootstrap
shell: bash
run: |
export PATH="$HOME/edm/bin:$PATH"
edm -c ./.github/data/edm.yml -t ${{ secrets.HATCHER_TOKEN }} install --version 3.8 -y click pyyaml
npm install -g configurable-http-proxy
- name: Build and test edge-native-base
shell: bash
env:
CI_EDM_CONFIG: ${{ github.workspace }}/.github/data/edm.yml
CI_EDM_TOKEN: ${{ secrets.HATCHER_TOKEN }}
run: |
export PATH="$HOME/edm/bin:$PATH"
set -e
cd .dev/edge-native-base
edm run -- python bootstrap.py -c $CI_EDM_CONFIG -t $CI_EDM_TOKEN
edm run -e edge-native-base -- python -m ci dev test
edm run -e edge-native-base -- python -m ci container build --generate-bundle --edm-config $CI_EDM_CONFIG --edm-token $CI_EDM_TOKEN
edm run -e edge-native-base -- python -m ci container test
edm run -e edge-native-base -- python -m ci preflight test
test-examples:
name: Test Examples
runs-on: ubuntu-latest
env:
SHELL: /bin/bash
INSTALLED_EDM_VERSION: "3.4.0"
EDM_API_TOKEN: ${{ secrets.HATCHER_TOKEN }}
strategy:
matrix:
example: [
{
directory: "Minimal",
environment: "edge-minimal-example",
image: "quay.io/enthought/edge-example-minimal:1.0.0"
},
{
directory: "Panel",
environment: "edge-panel-example",
image: "quay.io/enthought/edge-panel-example:1.1.0"
},
{
directory: "Plotly Dash",
environment: "edge-plotly-dash-example",
image: "quay.io/enthought/edge-plotly-dash-example:1.1.0"
},
{
directory: "React",
environment: "edge-react-example",
image: "quay.io/enthought/edge-native-app-flask-demo:1.1.0"
},
{
directory: "Streamlit",
environment: "edge-streamlit-example",
image: "quay.io/enthought/edge-streamlit-example:1.1.0"
}
]
fail-fast: false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup NodeJS 16.x
uses: actions/setup-node@v3
with:
node-version: 16
cache: 'npm'
cache-dependency-path: |
**/package-lock.json
- name: Set up EDM
uses: enthought/setup-edm-action@v2
with:
edm-version: ${{ env.INSTALLED_EDM_VERSION }}
- name: Bootstrap
shell: bash
run: |
export PATH="$HOME/edm/bin:$PATH"
set -e
cp "${{ github.workspace }}/.github/data/edm.yml" $HOME/.edm.yaml
edm envs create edm --version 3.8 --force
npm install -g configurable-http-proxy
- name: Build example
shell: bash
run: |
export PATH="$HOME/edm/bin:$PATH"
set -e
cd "${{ matrix.example.directory }}"
edm run -- python bootstrap.py --ci
edm run -e ${{ matrix.example.environment }} -- python -m ci build
- name: Preflight test
shell: bash
run: |
export PATH="$HOME/edm/bin:$PATH"
set -e
cd ${{ github.workspace }}/Tools
edm run -- python bootstrap.py --ci
edm run -e edge-preflight-tool -- python preflight.py ${{ matrix.example.image }}
- name: Archive logs if failed
if: ${{ failure() }}
uses: actions/upload-artifact@v3
with:
name: error-logs
path: |
${{ github.workspace }}/Tools/*.txt