-
Notifications
You must be signed in to change notification settings - Fork 4
78 lines (75 loc) · 2.64 KB
/
python_test.yml
File metadata and controls
78 lines (75 loc) · 2.64 KB
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
name: Test ukmon-pitools
on: [push]
jobs:
container_test:
name: run containerised test
runs-on: ubuntu-latest
container:
image: docker.io/markmac99/rmstestcont:latest
env:
MYENV: foo
ports:
- 22
- 443
steps:
- uses: actions/checkout@v3
- run: chmod +x ./tests/run_ub_tests.sh
- run: ./tests/run_ub_tests.sh
test:
name: run pi4 tests
runs-on: [arm64]
strategy:
matrix:
python-version: ["3.7"] #, "3.8", "3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
#- name: Set up Python ${{ matrix.python-version }}
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
source ~/vRMS/bin/activate
python -m pip install --upgrade pip
pip install -r ./requirements.txt
pip install --upgrade ruff pytest xmltodict pytest-cov
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with ruff
run: |
# stop the build if there are Python syntax errors or undefined names
source ~/vRMS/bin/activate
export PATH=/home/pi/.local/bin:$PATH
ruff check --output-format=github --select=E9,F63,F7,F82 --ignore=E501 --target-version=py37 .
# default set of ruff rules with GitHub Annotations
ruff check --output-format=github --ignore=E501 --target-version=py37 .
- name: Test with pytest
run: |
source ~/vRMS/bin/activate
export PATH=~/.local/bin:$PATH
pip install -r ~/source/RMS/requirements.txt
export PYTHONPATH=$PYTHONPATH:$(pwd):~/source/RMS
cd ../ukmon-pitools/
cp ~/source/ukmon-pitools/ukmon.ini .
cp ~/source/ukmon-pitools/live.key .
source ukmon.ini
pytest -v . --cov=. --cov-report=term-missing --cov-config=.coveragerc_lnx
# Run-refreshtools-on-Ubuntu:
# name: Run refreshTools on Ubuntu
# runs-on: ubuntu-20.04
# steps:
# - uses: actions/checkout@v3
# - name: test on ubuntu
# run: |
# mkdir ~/source
# pushd ~/source
# git clone https://github.com/markmac99/RMS.git
# cd RMS
# cat .config | sed 's/XX0001/UK0006/g' > .config.new
# mv -f .config.new .config
# grep stationID .config
# popd
# python -V
# export PYTHONPATH=.:~/source/RMS
# ./refreshTools.sh
# cat ~/.ssh/ukmon.pub
# cat ukmon.ini