diff --git a/.github/actions/linux/action.yaml b/.github/actions/linux/action.yaml new file mode 100644 index 0000000..3743358 --- /dev/null +++ b/.github/actions/linux/action.yaml @@ -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 diff --git a/.github/actions/windows-mac/action.yaml b/.github/actions/windows-mac/action.yaml new file mode 100644 index 0000000..7d7bd0c --- /dev/null +++ b/.github/actions/windows-mac/action.yaml @@ -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 diff --git a/.github/workflows/integration_tests.yaml b/.github/workflows/integration_tests.yaml index fc6f13d..113ce7c 100644 --- a/.github/workflows/integration_tests.yaml +++ b/.github/workflows/integration_tests.yaml @@ -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] + python-version: ["3.10", "3.12"] + 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 \ No newline at end of file + 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 diff --git a/.github/workflows/unit_tests.yaml b/.github/workflows/unit_tests.yaml index abaa791..ee24269 100644 --- a/.github/workflows/unit_tests.yaml +++ b/.github/workflows/unit_tests.yaml @@ -6,6 +6,10 @@ on: pull_request: branches: [ main ] +concurrency: + group: ${{ github.head_ref || github.run_id }} + cancel-in-progress: true + jobs: ruff: runs-on: ubuntu-latest @@ -22,6 +26,8 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macos-13] + fail-fast: false + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 @@ -30,7 +36,12 @@ 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/Windows) + if: runner.os != 'linux' + uses: ./.github/actions/windows-mac + diff --git a/requirements.txt b/requirements.txt index 44fcced..f237bce 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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