need to install setuptools to get pkg_resources; update year to 2024 #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |