|
1 | | -name: CI |
| 1 | +name: Test |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | branches: |
6 | 6 | - main |
7 | | - - CI |
8 | 7 | pull_request: |
9 | 8 | workflow_dispatch: |
10 | 9 |
|
| 10 | +defaults: |
| 11 | + run: |
| 12 | + shell: bash -l {0} |
| 13 | + |
11 | 14 | jobs: |
12 | | - miniconda: |
13 | | - name: Python ${{ matrix.python-version }}, OS ${{ matrix.os }} |
14 | | - runs-on: ${{ matrix.os }} |
15 | | - strategy: |
16 | | - matrix: |
17 | | - python-version: ['3.10', '3.11', '3.12'] |
18 | | - os: ["macos-latest", "ubuntu-latest", "windows-latest"] |
| 15 | + validate: |
| 16 | + runs-on: ubuntu-latest |
19 | 17 | steps: |
20 | | - - name: check out diffpy.pdffit2 |
21 | | - uses: actions/checkout@v3 |
22 | | - with: |
23 | | - repository: diffpy/diffpy.pdffit2 |
24 | | - path: . |
25 | | - fetch-depth: 0 # avoid shallow clone with no tags |
| 18 | + - name: Check out diffpy.pdffit2 |
| 19 | + uses: actions/checkout@v4 |
26 | 20 |
|
27 | | - - name: initialize miniconda |
28 | | - # this uses a marketplace action that sets up miniconda in a way that makes |
29 | | - # it easier to use. I tried setting it up without this and it was a pain |
| 21 | + - name: Initialize miniconda |
30 | 22 | uses: conda-incubator/setup-miniconda@v3 |
31 | 23 | with: |
32 | | - miniconda-version: "latest" |
33 | 24 | activate-environment: test |
34 | | - # environment.yml file is needed by this action. Because I don't want |
35 | | - # maintain this but rather maintain the requirements files it just has |
36 | | - # basic things in it like conda and pip |
| 25 | + auto-update-conda: true |
37 | 26 | environment-file: environment.yml |
38 | | - python-version: ${{ matrix.python-version }} |
39 | 27 | auto-activate-base: false |
40 | 28 |
|
41 | | - - name: install diffpy.pdffit2 requirements |
42 | | - shell: bash -l {0} |
| 29 | + - name: Conda config |
| 30 | + run: >- |
| 31 | + conda config --set always_yes yes |
| 32 | + --set changeps1 no |
| 33 | +
|
| 34 | + - name: Install diffpy.pdffit2 and requirements |
43 | 35 | run: | |
44 | | - conda config --set always_yes yes --set changeps1 no |
45 | | - conda config --add channels conda-forge |
46 | | - conda activate test |
47 | | - conda install --file requirements/build.txt |
48 | 36 | conda install --file requirements/run.txt |
49 | 37 | conda install --file requirements/test.txt |
50 | | - pip install . |
51 | | - - name: Validate diffpy.pdffit2 |
52 | | - shell: bash -l {0} |
53 | | - run: | |
54 | | - conda activate test |
55 | | - coverage run src/diffpy/pdffit2/tests/run.py |
56 | | - coverage report -m |
57 | | - codecov |
| 38 | + python -m pip install -r requirements/pip.txt |
| 39 | + python -m pip install . --no-deps |
58 | 40 |
|
59 | | -# Use this after migrating to pytest |
60 | | -# - name: Validate diffpy.pdffit2 |
61 | | -# shell: bash -l {0} |
62 | | -# run: | |
63 | | -# conda activate test |
64 | | -# coverage run -m pytest -vv -s |
65 | | -# coverage report -m |
66 | | -# codecov |
| 41 | + - name: Validate diffpy.pdffit2 |
| 42 | + run: python -m pytest |
0 commit comments