Check specific version #171
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Check specific version | |
on: | |
workflow_dispatch: | |
inputs: | |
python-version: | |
required: true | |
description: Specific version to check | |
type: string | |
allow-prereleases: | |
required: true | |
default: false | |
description: Include prereleases in the check | |
type: boolean | |
allow-build: | |
required: true | |
description: Behavior to use for the action | |
type: choice | |
default: info | |
options: | |
- info | |
- warn | |
- force | |
- allow | |
- error | |
env: | |
NODE_VERSION: 20 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Test build | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Setup NodeJS ${{ env.NODE_VERSION }} | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ env.NODE_VERSION }} | |
- name: Install dependencies | |
run: npm ci | |
- name: Build Typescript | |
run: npm run build | |
- name: Package with NCC | |
run: npm run package | |
- name: Upload built action | |
uses: actions/upload-artifact@v4 | |
with: | |
name: built-action | |
path: | | |
dist/index.js | |
.github/ | |
action.yml | |
retention-days: 1 | |
if-no-files-found: error | |
test_python_build: | |
needs: build | |
runs-on: ${{ matrix.os }} | |
name: Test build Python ${{ inputs.python-version }} for ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, windows-2022, ubuntu-22.04] | |
steps: | |
- name: Download built action | |
uses: actions/download-artifact@v4 | |
with: | |
name: built-action | |
- name: Test action with Python ${{ inputs.python-version }} | |
id: build | |
uses: ./ | |
with: | |
python-version: ${{ inputs.python-version }} | |
allow-build: ${{ inputs.allow-build }} | |
cache-build: true | |
allow-prereleases: ${{ inputs.allow-prereleases }} | |
- name: Setup Python ${{ inputs.python-version }} | |
uses: actions/setup-python@v5 | |
id: setup | |
with: | |
python-version: ${{ steps.build.outputs.python-version }} | |
architecture: ${{ steps.build.outputs.architecture }} | |
- name: Setup pip | |
run: ./.github/scripts/setup_pip.ps1 | |
shell: pwsh | |
env: | |
PYTHON_VERSION: ${{ steps.setup.outputs.python-version }} | |
- name: Install numpy | |
run: pip install numpy | |
- name: Check Python version | |
run: python ./.github/scripts/check_python_version.py ${{ inputs.python-version }} | |
- name: Check strict Python version | |
run: python ./.github/scripts/check_python_version.py ${{ steps.build.outputs.python-version }} | |
- name: Check Python structure | |
run: python ./.github/scripts/check_python_structure.py | |
test_python_cache: | |
needs: test_python_build | |
runs-on: ${{ matrix.os }} | |
name: Test cache Python ${{ inputs.python-version }} for ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [macos-12, windows-2022, ubuntu-22.04] | |
steps: | |
- name: Download built action | |
uses: actions/download-artifact@v4 | |
with: | |
name: built-action | |
- name: Test action with Python ${{ inputs.python-version }} | |
id: build | |
uses: ./ | |
with: | |
python-version: ${{ inputs.python-version }} | |
allow-build: ${{ inputs.allow-build }} | |
cache-build: true | |
allow-prereleases: ${{ inputs.allow-prereleases }} | |
- name: Setup Python ${{ inputs.python-version }} | |
uses: actions/setup-python@v5 | |
id: setup | |
with: | |
python-version: ${{ steps.build.outputs.python-version }} | |
architecture: ${{ steps.build.outputs.architecture }} | |
- name: Setup pip | |
run: ./.github/scripts/setup_pip.ps1 | |
shell: pwsh | |
env: | |
PYTHON_VERSION: ${{ steps.setup.outputs.python-version }} | |
- name: Install numpy | |
run: pip install numpy | |
- name: Check Python version | |
run: python ./.github/scripts/check_python_version.py ${{ inputs.python-version }} | |
- name: Check strict Python version | |
run: python ./.github/scripts/check_python_version.py ${{ steps.build.outputs.python-version }} | |
- name: Check Python structure | |
run: python ./.github/scripts/check_python_structure.py |