Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add post-release validation workflow #2058

Merged
merged 12 commits into from
May 8, 2024
38 changes: 38 additions & 0 deletions .github/actions/run_examples_using_pypi_uploads/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Run examples using PyPI uploads
description: Install module(s) from PyPI and run examples. Intended for release validation.
inputs:
module_name:
description: module name (e.g. "nidcpower")
required: true
default: ""
module_version:
description: module version (e.g. "1.8.1")
required: true
default: ""

runs:
using: composite
steps:
# The local wheel installation and single environment would have made using tox-system_tests.ini difficult.
# To keep things simple, we just use pip and pytest directly for a single Python version.
- run: py -3.12 -m venv --clear .venv
ni-jfitzger marked this conversation as resolved.
Show resolved Hide resolved
shell: powershell
- run: |
.venv\Scripts\Activate.ps1
python -m pip install ${{ inputs.module_name }}==${{ inputs.module_version }} pytest
shell: powershell
- if: ${{ inputs.module_name == 'nitclk' }}
run: |
.venv\Scripts\Activate.ps1
python -m pip install niscope==${{ inputs.module_version }}
shell: powershell
- if: ${{ inputs.module_name == 'niscope' }}
run: |
.venv\Scripts\Activate.ps1
python -m pip install numpy
shell: powershell
- run: |
.venv\Scripts\Activate.ps1
cd src/${{ inputs.module_name }}
python -m pytest ./examples -v
shell: powershell
48 changes: 48 additions & 0 deletions .github/workflows/check_latest_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: check_latest_release

on:
release:
types: [released]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
release_tag:
description: The GitHub release tag corresponding to the PyPI releases to test
required: true
default: non-existent-tag

jobs:
install-module-and-run-examples:
name: example_test
if: github.repository == 'ni/nimi-python'
# Use win32 nimibot
# win64 already handles post-commit testing for coverage
# linux doesn't support all modules
runs-on:
- self-hosted
- windows
- x64
- rdss-nimibot-win-10-py32
timeout-minutes: 30
strategy:
matrix:
module_name:
- nidigital
- nitclk
- nifgen
- nidcpower
- nidmm
- niscope
- nimodinst
- nise
- niswitch
steps:
- name: checkout repository
uses: actions/checkout@v3
# NOTE: we don't upload test coverage for this
- name: run examples using PyPI uploads
uses: ./.github/actions/run_examples_using_pypi_uploads
with:
module_name: ${{ matrix.module_name }}
module_version: ${{ github.event_name == 'workflow_dispatch' && inputs.release_tag || github.event.release.tag_name }}
1 change: 1 addition & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ Release Process
1. Merge the pull request to origin/master
1. Create a release on GitHub using the portion from the changelog for this release for the description
* Add the ZIP files under `generated/examples` for each module as a release artifact.
* 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.
1. Post-Release Steps
1. Create and checkout another branch for post-release changes
1. Update the module versions
Expand Down
Loading