Skip to content

Commit

Permalink
Run pytest on macos in GH actions
Browse files Browse the repository at this point in the history
  • Loading branch information
reuterbal committed Apr 20, 2024
1 parent 052e484 commit 8990cee
Showing 1 changed file with 53 additions and 11 deletions.
64 changes: 53 additions & 11 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,36 @@ on:

jobs:
pytest:
name: Python ${{ matrix.python-version }}
name: pytest

runs-on: ubuntu-20.04
strategy:
fail-fast: false # false: try to complete all jobs
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
name:
- linux python-3.8
- linux python-3.9
- linux python-3.10
- linux python-3.11
- macos python-3.11

include:
- name: linux python-3.8
os: ubuntu-20.04
python-version: 3.8
- name: linux python-3.9
os: ubuntu-20.04
python-version: 3.9
- name: linux python-3.10
os: ubuntu-20.04
python-version: '3.10'
- name: linux python-3.11
os: ubuntu-20.04
python-version: 3.11
- name: macos python-3.11
os: macos-14
python-version: 3.11

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -32,21 +55,37 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: 'pip'

- name: Refresh package lists
- name: Refresh package lists and install Loki dependencies
run: |
sudo apt-get -o Acquire::Retries=3 update || true
if [[ "${{ matrix.os }}" =~ macos ]]; then
brew install gcc@13 graphviz
else
sudo apt-get -o Acquire::Retries=3 update || true
sudo apt-get -o Acquire::Retries=3 install -y graphviz gfortran
fi
- name: Install OMNI + CLAW dependencies on Linux
if: ${{ ! startsWith(matrix.os, 'macos') }}
run: |
sudo apt-get -o Acquire::Retries=3 install -y byacc flex openjdk-11-jdk cmake ant
- name: Install Loki dependencies
- name: Install Loki on Linux
if: ${{ ! startsWith(matrix.os, 'macos') }}
run: |
sudo apt-get -o Acquire::Retries=3 install -y graphviz gfortran
./install --with-claw --with-ofp --with-examples --with-tests --with-dace
- name: Install OMNI + CLAW dependencies
- name: Install Loki on MacOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
sudo apt-get -o Acquire::Retries=3 install -y byacc flex openjdk-11-jdk cmake ant
export CC=gcc-13 CXX=g++-13 FC=gfortran-13 F90=gfortran-13
./install --with-examples --with-tests
- name: Install Loki
- name: Add GNU compiler to environment on MacOS
if: ${{ startsWith(matrix.os, 'macos') }}
run: |
./install --with-claw --with-ofp --with-examples --with-tests --with-dace
echo "export PATH=/opt/homebrew/bin:\${PATH}" >> loki-activate
echo "export CC=gcc-13 FC=gfortran-13 F90=gfortran-13" >> loki-activate
cat loki-activate
- name: Install up-to-date CMake
run: |
Expand All @@ -60,6 +99,7 @@ jobs:
- name: Upload loki coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ ! startsWith(matrix.os, 'macos') }}
with:
flags: loki
files: ./coverage.xml
Expand All @@ -73,6 +113,7 @@ jobs:
- name: Upload transformations coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ ! startsWith(matrix.os, 'macos') }}
with:
flags: transformations
files: ./coverage.xml
Expand All @@ -86,6 +127,7 @@ jobs:
- name: Upload lint_rules coverage report to Codecov
uses: codecov/codecov-action@v4
if: ${{ ! startsWith(matrix.os, 'macos') }}
with:
flags: lint_rules
files: ./coverage.xml
Expand Down

0 comments on commit 8990cee

Please sign in to comment.