Skip to content

Commit

Permalink
Merge pull request #11 from AstarVienna/hb/usedevops
Browse files Browse the repository at this point in the history
Use DevOps workflow
  • Loading branch information
hugobuddel authored Jul 7, 2023
2 parents 4221e26 + 88ccbf7 commit b814797
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 55 deletions.
37 changes: 2 additions & 35 deletions .github/workflows/minimumdependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,43 +14,10 @@ on:
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:

# Allow this workflow to be called from other repositories.
workflow_call:

schedule:
- # Run every day at 5:00 UTC.
- cron: "0 5 * * *"

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
# Keep python-version on the lowest version from pyproject.toml.
# Also update the regexp below.
python-version: 3.8
- name: Install dependencies
run: |
# Hardcode the minimum version of the dependencies.
# E.g. '"astropy>=4.0"' to '"astropy==4.0"'
# -i cannot be used because that is hard to get compatible with
# Linux, MacOS, and Windows.
# Single quotes are necessary for Windows compatibility.
sed 's/>=/==/g' pyproject.toml > pyproject.toml.new
cp pyproject.toml.new pyproject.toml
# It is difficult to make a regexp that generalizes the Python
# version and also works Linux, Windows, and MacOS.
sed 's/==3.8/==3.8.*/g' pyproject.toml > pyproject.toml.new2
cp pyproject.toml.new2 pyproject.toml
python -m pip install --upgrade pip
pip install .[test]
- name: Run Pytest
run: pytest
call-minimum-dependencies:
uses: AstarVienna/DevOps/.github/workflows/minimumdependencies.yml@master
23 changes: 3 additions & 20 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Tests

on:
push:
branches:
Expand All @@ -11,23 +12,5 @@ on:
workflow_dispatch:

jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python-version: ['3.8', '3.9', '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
- name: Run Pytest
run: pytest
call-tests:
uses: AstarVienna/DevOps/.github/workflows/tests.yml@master

0 comments on commit b814797

Please sign in to comment.