-
Notifications
You must be signed in to change notification settings - Fork 4
85 lines (76 loc) · 2.34 KB
/
test_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: Release
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/
build_sdist_and_wheel:
name: Build source distribution and pure python wheel
runs-on: ubuntu-20.04
needs: test
if: startsWith(github.ref, 'refs/tags/v')
environment:
name: pypi
url: https://pypi.org/p/libpyvinyl
permissions:
id-token: write
steps:
- id: checkout
uses: actions/checkout@v3
- name: requirements
run : |
pip install -r requirements/dev.txt
pip install build
- name: build
run : |
python -m build --sdist
python -m build --wheel
- name: Upload to pypi
uses: pypa/gh-action-pypi-publish@release/v1
- name: upload artifact
uses: actions/upload-artifact@v4
with:
name: sdist-wheel
path: dist/