-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (62 loc) · 2.13 KB
/
Copy pathautomated-testing.yml
File metadata and controls
64 lines (62 loc) · 2.13 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
name: Automated Testing
env:
AWS_REGION: eu-west-2
permissions:
id-token: write
contents: read
on:
push:
branches: [dev, markmac99]
pull_request:
# The branches below must be a subset of the branches above
branches: [dev, markmac99]
jobs:
conttests:
runs-on: thelinux
container:
image: docker.io/markmac99/ukmdatester
credentials:
username: ${{ secrets.DH_LOGIN_MM }}
password: ${{ secrets.DH_PATT_MM }}
env:
BRANCH: ${{ github.head_ref || github.ref_name }}
volumes:
- testdata:/data
steps:
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@v4.0.1
with:
role-to-assume: arn:aws:iam::183798037734:role/testingRole
role-session-name: github_aws_testing
aws-region: ${{ env.AWS_REGION }}
- name: remote tests
run: |
if [ ! -f /data/admin/cameraLocs.json ] ; then
echo "getting test data"
curl https://archive.ukmeteors.co.uk/browse/testdata/testdata.tar.gz -o /data/testdata.tar.gz
cd /data && tar -xzf ./testdata.tar.gz
else
echo "test data available"
fi
aws sts get-caller-identity
pip install --upgrade MeteorTools | grep -v 'already satisfied'
pip install pytest pytest-cov | grep -v 'already satisfied'
[ -d ./ukmda-dataprocessing ] && rm -Rf ./ukmda-dataprocessing
git clone https://github.com/ukmda/ukmda-dataprocessing.git
cd ./ukmda-dataprocessing/
git checkout $BRANCH
cd ./archive/ukmon_pylib/
curdir=$(pwd -P)
export DATADIR=/data
echo DATADIR is $DATADIR curdir is $curdir
export PYTHONPATH=/WesternMeteorPyLib:/RMS:${curdir}
pytest -v ./tests --cov=. --cov-report=term-missing
apitests:
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3
- name: run api tests
run: |
chmod +x ./tests/api_tests.sh
./tests/api_tests.sh