-
Notifications
You must be signed in to change notification settings - Fork 8
76 lines (72 loc) · 3.78 KB
/
test_installation.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
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.4.0
virtualenvs-create: true
installer-parallel: false
- name: Install package
run: |
poetry install --with tests --no-interaction
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test conversion to .txt models
run: |
poetry run tigger-convert $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html /tmp/output.txt -f \
--output-format "name ra_d dec_d i q u v i q u v spi rm emaj_s emin_s pa_d freq0"
poetry run tigger-convert $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html /tmp/output.recentred.txt -f --center 85.5deg,49.9deg --rename \
--output-format "name ra_d dec_d i q u v i q u v spi rm emaj_s emin_s pa_d freq0"
echo "Checking reference LSM"
diff $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.reference.txt /tmp/output.txt
echo "Checking recentred reference LSM"
diff $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.recentred.reference.txt /tmp/output.recentred.txt
- name: Test reverse conversion to .lsm.html models
run: |
poetry run tigger-convert /tmp/output.txt /tmp/output.lsm.html -f
- name: Test .gaul conversions
run: |
poetry run tigger-convert $GITHUB_WORKSPACE/test/deep4.gaul /tmp/deep4.lsm.html -f
poetry run tigger-convert $GITHUB_WORKSPACE/test/deep4.gaul /tmp/deep4.txt -f --output-format "name ra_d dec_d i q u v spi rm emaj_s emin_s pa_d freq0"
diff $GITHUB_WORKSPACE/test/deep4.reference.txt /tmp/deep4.txt
- name: Test .AIPSCC conversions
run: |
gunzip <$GITHUB_WORKSPACE/test/3C147-L-A-CLEAN.fits.gz >/tmp/3C147-L-A-CLEAN.fits
poetry run tigger-convert /tmp/3C147-L-A-CLEAN.fits /tmp/3C147-L-A-CLEAN.fits.lsm.html -f
poetry run tigger-convert /tmp/3C147-L-A-CLEAN.fits.lsm.html /tmp/3C147-L-A-CLEAN.txt -f --output-format "name ra_d dec_d i q u v"
zdiff $GITHUB_WORKSPACE/test/3C147-L-A-CLEAN.txt.gz /tmp/3C147-L-A-CLEAN.txt
- name: Testing tigger-restore and tigger-make-brick
run: |
cp $GITHUB_WORKSPACE/test/3C147tmp.fits /tmp
poetry run tigger-make-brick $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html /tmp/3C147tmp.fits
poetry run tigger-restore -f $GITHUB_WORKSPACE/test/3C147tmp.fits $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html /tmp/restored.fits
- name: Test tigger-tag
run: |
poetry run tigger-tag $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html 'r<0.5d' inner=1 -o /tmp/tmp.lsm.html -f
- name: Test .lsm to ds9 region file conversion
run: |
echo "Checking lsm.html to .reg conversion"
poetry run tigger-convert $GITHUB_WORKSPACE/test/3C147-HI6.refmodel.lsm.html /tmp/3C147-HI6.refmodel.lsm.reg -f