Skip to content

Commit 1f93c35

Browse files
Add post-release validation workflow (#2058)
* Add post-release validation workflow * reduce triggers for pr workflows * temp change for testing * Fix installation mistakes * Use venv * Revert "temp change for testing" This reverts commit 4b7edb9. * Revert "reduce triggers for pr workflows" This reverts commit 992125d. * Fix typo * Add links to description in Release Process * Update .github/actions/run_examples_using_pypi_uploads/action.yml Capitalize PyPI Co-authored-by: Marcos <[email protected]> * Apply suggestions from code review Give examples of action parameter values Co-authored-by: Marcos <[email protected]> * Apply suggestions from code review Capitalize PyPI --------- Co-authored-by: Marcos <[email protected]>
1 parent cba6e54 commit 1f93c35

File tree

3 files changed

+87
-0
lines changed

3 files changed

+87
-0
lines changed
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Run examples using PyPI uploads
2+
description: Install module(s) from PyPI and run examples. Intended for release validation.
3+
inputs:
4+
module_name:
5+
description: module name (e.g. "nidcpower")
6+
required: true
7+
default: ""
8+
module_version:
9+
description: module version (e.g. "1.8.1")
10+
required: true
11+
default: ""
12+
13+
runs:
14+
using: composite
15+
steps:
16+
# The local wheel installation and single environment would have made using tox-system_tests.ini difficult.
17+
# To keep things simple, we just use pip and pytest directly for a single Python version.
18+
- run: py -3.12 -m venv --clear .venv
19+
shell: powershell
20+
- run: |
21+
.venv\Scripts\Activate.ps1
22+
python -m pip install ${{ inputs.module_name }}==${{ inputs.module_version }} pytest
23+
shell: powershell
24+
- if: ${{ inputs.module_name == 'nitclk' }}
25+
run: |
26+
.venv\Scripts\Activate.ps1
27+
python -m pip install niscope==${{ inputs.module_version }}
28+
shell: powershell
29+
- if: ${{ inputs.module_name == 'niscope' }}
30+
run: |
31+
.venv\Scripts\Activate.ps1
32+
python -m pip install numpy
33+
shell: powershell
34+
- run: |
35+
.venv\Scripts\Activate.ps1
36+
cd src/${{ inputs.module_name }}
37+
python -m pytest ./examples -v
38+
shell: powershell
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: check_latest_release
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
# Allows you to run this workflow manually from the Actions tab
8+
workflow_dispatch:
9+
inputs:
10+
release_tag:
11+
description: The GitHub release tag corresponding to the PyPI releases to test
12+
required: true
13+
default: non-existent-tag
14+
15+
jobs:
16+
install-module-and-run-examples:
17+
name: example_test
18+
if: github.repository == 'ni/nimi-python'
19+
# Use win32 nimibot
20+
# win64 already handles post-commit testing for coverage
21+
# linux doesn't support all modules
22+
runs-on:
23+
- self-hosted
24+
- windows
25+
- x64
26+
- rdss-nimibot-win-10-py32
27+
timeout-minutes: 30
28+
strategy:
29+
matrix:
30+
module_name:
31+
- nidigital
32+
- nitclk
33+
- nifgen
34+
- nidcpower
35+
- nidmm
36+
- niscope
37+
- nimodinst
38+
- nise
39+
- niswitch
40+
steps:
41+
- name: checkout repository
42+
uses: actions/checkout@v3
43+
# NOTE: we don't upload test coverage for this
44+
- name: run examples using PyPI uploads
45+
uses: ./.github/actions/run_examples_using_pypi_uploads
46+
with:
47+
module_name: ${{ matrix.module_name }}
48+
module_version: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.event.release.tag_name }}

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ Release Process
172172
1. Merge the pull request to origin/master
173173
1. Create a release on GitHub using the portion from the changelog for this release for the description
174174
* Add the ZIP files under `generated/examples` for each module as a release artifact.
175+
* This should trigger the [check_latest_release](.github/workflows/check_latest_release.yml) workflow. Check the [results](https://github.com/ni/nimi-python/actions/workflows/check_latest_release.yml) before continuing.
175176
1. Post-Release Steps
176177
1. Create and checkout another branch for post-release changes
177178
1. Update the module versions

0 commit comments

Comments
 (0)