Skip to content

Commit

Permalink
Splitting CI into test and release.
Browse files Browse the repository at this point in the history
  • Loading branch information
Carsten Fortmann-Grote committed May 3, 2024
1 parent 89b4dc0 commit ea16fd1
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 12 deletions.
21 changes: 9 additions & 12 deletions .github/workflows/ci.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: CI
on: [push, pull_request]

name: Test
on:
push:
branches: [main]

jobs:
test:
Expand Down Expand Up @@ -56,10 +57,10 @@ jobs:
name: Build source distribution and pure python wheel
runs-on: ubuntu-20.04
needs: test
if: github.ref == 'refs/heads/CICD'
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: testpypi
url: https://test.pypi.org/p/libpyvinyl
name: pypi
url: https://pypi.org/p/libpyvinyl
permissions:
id-token: write
steps:
Expand All @@ -69,18 +70,14 @@ jobs:
run :
pip install -r requirements/dev.txt
pip install build
- id: bumpversion
uses: jasonamyers/github-bumpversion-action@v1.0.5
env:
GITHUB_TOKEN: ${{ github.token }}
- name: build
run : |
python -m build --sdist
python -m build --wheel
- name: Upload to test.pypi
- name: Upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
repository-url: https://pypi.org/legacy/
- name: upload artifact
uses: actions/upload-artifact@v4
with:
Expand Down
56 changes: 56 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Test
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-20.04
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: mpi4py/setup-mpi@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install production dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pytest
pip install .
- name: Unit testing
run: |
pytest .
- name: Test McStasScript
run: |
git clone https://github.com/PaNOSC-ViNYL/McStasScript.git
cd McStasScript
pip install -e .
cd mcstasscript/tests
pytest .
cd
- name: Test SimEx-Lite
run: |
# Install pysingfel backend from the simex branch
pip install git+https://github.com/JunCEEE/pysingfel.git@simex
# Install and test SimEx-Lite
git clone --recursive https://github.com/PaNOSC-ViNYL/SimEx-Lite.git
cd SimEx-Lite
pip install -e .
git clone https://github.com/PaNOSC-ViNYL/SimEx-Lite-testFiles testFiles
pytest tests
- name: Install development dependencies
run: |
pip install -r requirements/dev.txt
- name: Code formatting
run: |
black --check libpyvinyl/

0 comments on commit ea16fd1

Please sign in to comment.