Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes action workflows #13

Merged
merged 14 commits into from
Aug 12, 2024
18 changes: 18 additions & 0 deletions .github/actions/linux/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
inputs:
pytest-options:
description: "Extra options to pass to Pytest"
default: ''
runs:
using: "composite"
steps:
- name: Install apt dependencies
shell: bash -l {0}
run: |
sudo apt update
sudo apt install xvfb libqt5x11extras5 libgl1-mesa-glx '^libxcb.*-dev'
- name: Install RasCAL2
shell: bash -l {0}
run: pip install .
- name:
shell: bash -l {0}
run: xvfb-run pytest -s tests/ ${{ inputs.pytest-options }} --cov=rascal2 --cov-report=term
13 changes: 13 additions & 0 deletions .github/actions/macos/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
inputs:
pytest-options:
description: "Extra options to pass to Pytest"
default: ''
runs:
using: "composite"
steps:
- name: Install RasCAL2
shell: bash -l {0}
run: pip install .
- name: Run Pytest
shell: bash -l {0}
run: pytest -s tests/ ${{ inputs.pytest-options }} --cov=rascal2 --cov-report=term
13 changes: 13 additions & 0 deletions .github/actions/windows/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
inputs:
pytest-options:
description: "Extra options to pass to Pytest"
default: ''
runs:
using: "composite"
steps:
- name: Install RasCAL2
shell: bash -l {0}
run: pip install .
- name: Run Pytest
shell: bash -l {0}
run: pytest -s tests/ ${{ inputs.pytest-options }} --cov=rascal2 --cov-report=term
29 changes: 18 additions & 11 deletions .github/workflows/integration_tests.yaml
alexhroom marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,31 @@
name: Integration tests
on:
pull_request_review:
types: [approved]
types: [submitted]
workflow_dispatch: # <-- can be triggered manually!

jobs:
integration-tests:
if: github.event.review.state == 'approved'
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
python-version: [3.10, 3.11, 3.12]
alexhroom marked this conversation as resolved.
Show resolved Hide resolved
runs-on: ${{ matrix.os }}
steps:
- name: Set up Python version ${{ matrix.version }}
uses: actions/setup-python@v4
- uses: actions/checkout@v4
- name: Set up Conda environment from environment.yaml
uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.version }}
- name: Install package and requirements
run: |
pip install -r requirements.txt
pip install -r requirements-dev.txt
pip install .
- name: Run pytest
run: pytest -s tests/ --cov=rascal2 --cov-report=term
environment-file: environment.yaml
auto-activate-base: false
python-version: ${{ matrix.version }} # this overwrites python version in environment.yaml
- name: Install and run tests (Linux)
if: runner.os == 'linux'
uses: ./.github/actions/linux
- name: Install and run tests (MacOS)
if: runner.os == 'macos'
uses: ./.github/actions/macos
- name: Install and run tests (Windows)
if: runner.os == 'windows'
uses: ./.github/actions/windows
22 changes: 18 additions & 4 deletions .github/workflows/unit_tests.yaml
alexhroom marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-13]
fail-fast: false
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4
Expand All @@ -30,7 +32,19 @@ jobs:
with:
environment-file: environment.yaml
auto-activate-base: false
- name: Install RasCAL2
run: pip install .
- name: Run pytest
run: pytest -s tests/ -m "not slow" --cov=rascal2 --cov-report=term
- name: Install and run tests (Linux)
if: runner.os == 'linux'
uses: ./.github/actions/linux
with:
pytest-options: '-m "not slow"'
- name: Install and run tests (MacOS)
if: runner.os == 'macos'
uses: ./.github/actions/macos
with:
pytest-options: '-m "not slow"'
- name: Install and run tests (Windows)
if: runner.os == 'windows'
uses: ./.github/actions/windows
with:
pytest-options: '-m "not slow"'

4 changes: 2 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PyInstaller==6.9.0
PyQt6==6.7.1
PyQt6==6.7.0
PyQt6-Qt6==6.7.2
RATapi @ git+https://github.com/RascalSoftware/python-RAT@main
RATapi==0.0.0.dev1
Loading