Skip to content

fix workflow

fix workflow #2

Workflow file for this run

name: Tests
on:
pull_request:
push:
workflow_dispatch:
jobs:
linter:
name: Linter
runs-on: ubuntu-latest
env:
ENV_NAME: linting
PYTHON: 3.8
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Setup Environment
run: |
pip install pre-commit
- name: Linting
run: |
pre-commit install
pre-commit run -a
datacache:
name: Cache Data
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Get current date
id: date
run: echo "name=date::$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: cache-kernels
uses: actions/cache@v4
with:
path: ~/ap_cache
key: kernel_cache-${{ steps.date.outputs.date }}
- name: Download and cache
run: |
pip install astropy
python ./ci/cache_data.py save
if: steps.cache-kernels.outputs.cache-hit != 'true'
tests:
env:
ENV_NAME: tests
PYTHON: ${{ matrix.python-version }}
OS: ${{ matrix.os }}
needs: [datacache, linter]
name: Testing
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get current date
id: date
run: echo "name=date::$(date +'%Y-%m-%d')" >> $GITHUB_OUTPUT
- name: load-cache
uses: actions/cache@v2
with:
path: ~/ap_cache
key: kernel_cache-${{ steps.date.outputs.date }}
- name: load kernels
run: |
pip install astropy
python ./ci/cache_kernels.py load
- name: Install
run: |
pip install .[dev]
- name: Run Tests
run: |
python -m pytest