|
12 | 12 | - cron: '0 7 * * *'
|
13 | 13 |
|
14 | 14 | jobs:
|
| 15 | + |
| 16 | + generate-requirement-files: |
| 17 | + runs-on: ubuntu-latest |
| 18 | + steps: |
| 19 | + - uses: actions/checkout@v4 |
| 20 | + - name: create empty environment.yml |
| 21 | + run: | |
| 22 | + cat > environment.yml <<EOF |
| 23 | + name: pypardiso |
| 24 | + channels: |
| 25 | + - conda-forge |
| 26 | + dependencies: |
| 27 | + EOF |
| 28 | + - name: generate requirements |
| 29 | + uses: mikefarah/yq@master |
| 30 | + with: |
| 31 | + cmd: | |
| 32 | + yq '.project.dependencies' pyproject.toml -oy > reqs.yml |
| 33 | + cat reqs.yml >> environment.yml |
| 34 | + yq '.[]' reqs.yml > requirements.txt |
| 35 | + - name: Show requirement files |
| 36 | + run: | |
| 37 | + cat environment.yml |
| 38 | + echo |
| 39 | + cat requirements.txt |
| 40 | + - name: Upload environment.yml |
| 41 | + uses: actions/upload-artifact@v3 |
| 42 | + with: |
| 43 | + name: environment.yml |
| 44 | + path: environment.yml |
| 45 | + - name: Upload requirements.txt |
| 46 | + uses: actions/upload-artifact@v3 |
| 47 | + with: |
| 48 | + name: requirements.txt |
| 49 | + path: requirements.txt |
| 50 | + |
| 51 | + |
15 | 52 | conda-tests:
|
16 | 53 | runs-on: ${{ matrix.os }}
|
| 54 | + needs: generate-requirement-files |
17 | 55 | strategy:
|
18 | 56 | fail-fast: false
|
19 | 57 | matrix:
|
|
22 | 60 |
|
23 | 61 | steps:
|
24 | 62 | - uses: actions/checkout@v4
|
| 63 | + - uses: actions/download-artifact@v3 |
| 64 | + with: |
| 65 | + name: environment.yml |
25 | 66 | - name: Set up miniconda with python ${{ matrix.python-version }}
|
26 | 67 | uses: conda-incubator/setup-miniconda@v2
|
27 | 68 | with:
|
|
50 | 91 |
|
51 | 92 | pip-tests:
|
52 | 93 | runs-on: ${{ matrix.os }}
|
| 94 | + needs: generate-requirement-files |
53 | 95 | strategy:
|
54 | 96 | fail-fast: false
|
55 | 97 | matrix:
|
|
60 | 102 | - uses: actions/setup-python@v4
|
61 | 103 | with:
|
62 | 104 | python-version: ${{ matrix.python-version }}
|
| 105 | + - uses: actions/download-artifact@v3 |
| 106 | + with: |
| 107 | + name: requirements.txt |
63 | 108 | - name: Install dependencies
|
64 | 109 | run: |
|
65 | 110 | pip install -r requirements.txt
|
|
0 commit comments