-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (100 loc) · 3.25 KB
/
almanac-tests.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
# GitHub Actions workflow for mmt_almanac testing and continuous integration.
#
# This file configures testing using tox and tox.ini to define and configure the test environments.
name: Python Tests
on:
push:
branches:
- main
pull_request:
jobs:
matrix_tests:
runs-on: ${{ matrix.os }}
if: "!contains(github.event.head_commit.message, '[ci skip]')"
strategy:
matrix:
os: [ubuntu-latest]
python-ver: [12]
tox-env: [cov, alldeps, astropydev, astroplandev]
steps:
- uses: actions/checkout@v3
- name: Set up python 3.${{ matrix.python-ver }} with tox environment ${{ matrix.tox-env }} on ${{ matrix.os }}
uses: actions/setup-python@v4
with:
python-version: 3.${{ matrix.python-ver }}
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install numpy tox
- name: Test with tox
run: |
tox -e py3${{ matrix.python-ver }}-${{ matrix.tox-env }}
- name: Upload coverage to codecov
if: matrix.tox-env == 'cov' && matrix.python-ver == '8'
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV }}
file: ./coverage.xml
fail_ci_if_error: true
doc_test:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v3
- name: Set up Python to build docs with sphinx
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Build and check docs using tox
run: |
tox -e build_docs
tox -e linkcheck
make_almanac:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v3
- name: Set up Python to run almanac generation script
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel setuptools
sudo apt update -q -y
sudo apt install -q -y enscript ghostscript
- name: Install almanac package
run: |
pip install -e .[all]
- name: Run yearly_almanac and convert to PDF
run: |
yearly_almanac -o almanac.txt -y 2024
enscript -B -r -f Courier9 -p almanac.ps almanac.txt
gs -q -dSAFER -sBATCH -dNOPAUSE -sDEVICE=pdfwrite -sOutputFile=almanac.pdf \
-dAutoRotatePages=/None -c "<</Orientation 3>> setpagedevice" -f almanac.ps
- name: Upload generated almanac PDF
uses: actions/upload-artifact@v2
with:
name: latest-almanac
path: almanac.pdf
codestyle:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[ci skip]')"
steps:
- uses: actions/checkout@v3
- name: Python codestyle check
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
python -m pip install tox
- name: Check codestyle using tox
run: |
tox -e codestyle