-
Notifications
You must be signed in to change notification settings - Fork 1
137 lines (113 loc) · 3.28 KB
/
main.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
---
name: CI
on:
# Triggers the workflow on push or pull request events
push:
pull_request:
release:
tags:
- 'v*'
types: [published]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
Server_tests:
name: Server tests
runs-on: ubuntu-latest
# Test different python versions
strategy:
fail-fast: false
matrix:
python-version: ['3.9']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check out repo
uses: actions/checkout@v4
- name: Setup InfluxDB
uses: influxdata/influxdb-action@v3
with:
influxdb_version: 1.11.5
influxdb_org: influxdata
influxdb_user: ""
influxdb_password: ""
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: Display Python version
run: |
python -c "import sys; print(sys.version)"
echo coverage: .${{ matrix.coverage }}.
- name: Install dependencies
run: |
python -m pip install pip setuptools wheel
pip install --upgrade pip
pip install -r ./requirements/test.txt
pip install flake8
- name: Run flake8
run: |
cd ./server
flake8 .
- name: Run tests with coverage
run: |
cd ./server
coverage run -m pytest test --cov-report xml --cov=server
timeout-minutes: 20
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
if: success()
Client_build:
name: Client build
runs-on: ubuntu-latest
steps:
- name: Run errands
run: |
sudo apt -y install curl
- name: Checkout
uses: actions/checkout@v4
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "DIR=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache
with:
path: ${{ steps.yarn-cache-dir-path.outputs.DIR }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: "20.11.1"
cache: "yarn"
cache-dependency-path: '**/yarn.lock'
- name: Install dependencies
shell: bash
run: |
source ~/.nvm/nvm.sh
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.22.19
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
yarn -v
# nvm install "16.10.0"
# nvm use "16.10.0"
env:
VNM_DIR: ~/.nvm
- name: Run tests
shell: bash
run: |
cd client
yarn install
CI=true yarn test
yarn build
env:
CI: true
VNM_DIR: ~/.nvm
INLINE_RUNTIME_CHUNK: False
IMAGE_INLINE_SIZE_LIMIT: 0
timeout-minutes: 15