|
51 | 51 |
|
52 | 52 | steps: |
53 | 53 | - name: Run nox |
54 | | - uses: frequenz-floss/gh-action-nox@v1.0.1 |
| 54 | + uses: shsms/gh-action-nox@windows-support |
55 | 55 | with: |
56 | 56 | python-version: ${{ matrix.python }} |
57 | 57 | nox-session: ${{ matrix.nox-session }} |
@@ -102,87 +102,35 @@ jobs: |
102 | 102 | - name: Setup Python |
103 | 103 | uses: frequenz-floss/[email protected] |
104 | 104 | with: |
105 | | - python-version: ${{ env.DEFAULT_PYTHON_VERSION }} |
| 105 | + python-version: ${{ matrix.python }} |
106 | 106 | dependencies: build |
107 | 107 |
|
108 | 108 | - name: Build the source and binary distribution |
109 | 109 | run: python -m build |
110 | 110 |
|
| 111 | + - name: Test installing wheel |
| 112 | + run: python -m pip install dist/*.whl |
| 113 | + |
111 | 114 | - name: Upload distribution files |
112 | 115 | uses: actions/upload-artifact@v5 |
113 | 116 | with: |
114 | 117 | name: dist-packages-${{ matrix.platform.target }}-${{ matrix.python }} |
115 | 118 | path: dist/ |
116 | 119 | if-no-files-found: error |
117 | 120 |
|
118 | | - test-installation: |
119 | | - name: Test package installation |
120 | | - needs: ["build"] |
121 | | - strategy: |
122 | | - fail-fast: false |
123 | | - matrix: |
124 | | - platform: |
125 | | - - target: ubuntu-24.04 |
126 | | - - target: ubuntu-24.04-arm |
127 | | - - target: windows-latest |
128 | | - - target: macos-15-intel |
129 | | - - target: macos-15 |
130 | | - python: |
131 | | - - "3.11" |
132 | | - - "3.12" |
133 | | - - "3.13" |
134 | | - - "3.14" |
135 | | - runs-on: ${{ matrix.target }} |
136 | | - |
137 | | - steps: |
138 | | - - name: Setup Git |
139 | | - uses: frequenz-floss/[email protected] |
140 | | - |
141 | | - - name: Print environment (debug) |
142 | | - run: env |
143 | | - |
144 | | - - name: Download package |
145 | | - uses: actions/download-artifact@v6 |
146 | | - with: |
147 | | - name: dist-packages-${{ matrix.platform.target }}-${{ matrix.python }} |
148 | | - path: dist |
149 | | - |
150 | | - # This is necessary for the `pip` caching in the setup-python action to work |
151 | | - - name: Fetch the pyproject.toml file for this action hash |
152 | | - env: |
153 | | - GH_TOKEN: ${{ github.token }} |
154 | | - REPO: ${{ github.repository }} |
155 | | - REF: ${{ github.sha }} |
156 | | - run: | |
157 | | - set -ux |
158 | | - gh api \ |
159 | | - -X GET \ |
160 | | - -H "Accept: application/vnd.github.raw" \ |
161 | | - "/repos/$REPO/contents/pyproject.toml?ref=$REF" \ |
162 | | - > pyproject.toml |
163 | | -
|
164 | | - - name: Setup Python |
165 | | - uses: frequenz-floss/[email protected] |
166 | | - with: |
167 | | - python-version: ${{ matrix.python }} |
168 | | - dependencies: dist/*.whl |
169 | | - |
170 | | - - name: Print installed packages (debug) |
171 | | - run: python -m pip freeze |
172 | | - |
173 | | - # This job runs if all the `test-installation` matrix jobs ran and succeeded. |
| 121 | + # This job runs if all the `build` matrix jobs ran and succeeded. |
174 | 122 | # It is only used to have a single job that we can require in branch |
175 | 123 | # protection rules, so we don't have to update the protection rules each time |
176 | 124 | # we add or remove a job from the matrix. |
177 | | - test-installation-all: |
178 | | - # The job name should match the name of the `test-installation` job. |
179 | | - name: Test package installation |
180 | | - needs: ["test-installation"] |
181 | | - # We skip this job only if test-installation was also skipped |
182 | | - if: always() && needs.test-installation.result != 'skipped' |
| 125 | + build-all: |
| 126 | + # The job name should match the name of the `build` job. |
| 127 | + name: Build distribution packages |
| 128 | + needs: ["build"] |
| 129 | + # We skip this job only if build was also skipped |
| 130 | + if: always() && needs.build.result != 'skipped' |
183 | 131 | runs-on: ubuntu-24.04 |
184 | 132 | env: |
185 | | - DEPS_RESULT: ${{ needs.test-installation.result }} |
| 133 | + DEPS_RESULT: ${{ needs.build.result }} |
186 | 134 | steps: |
187 | 135 | - name: Check matrix job result |
188 | 136 | run: test "$DEPS_RESULT" = "success" |
@@ -222,7 +170,7 @@ jobs: |
222 | 170 |
|
223 | 171 | publish-docs: |
224 | 172 | name: Publish documentation website to GitHub pages |
225 | | - needs: ["nox-all", "test-installation-all"] |
| 173 | + needs: ["nox-all", "build-all"] |
226 | 174 | if: github.event_name == 'push' |
227 | 175 | runs-on: ubuntu-24.04 |
228 | 176 | permissions: |
|
0 commit comments