123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- 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
- env:
- NODE_VERSION: 16
- jobs:
- build:
- runs-on: ubuntu-latest
- name: Test build
- steps:
- - name: Checkout code
- uses: actions/checkout@v3
- with:
- submodules: recursive
- - name: Setup NodeJS ${{ env.NODE_VERSION }}
- uses: actions/setup-node@v3
- 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@v3
- 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-latest, windows-latest, ubuntu-latest]
- steps:
- - name: Download built action
- uses: actions/download-artifact@v3
- with:
- name: built-action
- - name: Test action with Python ${{ inputs.python-version }}
- id: build
- uses: ./
- with:
- python-version: ${{ inputs.python-version }}
- allow-build: force
- cache-build: true
- allow-prereleases: ${{ inputs.allow-prereleases }}
- - name: Setup Python ${{ inputs.python-version }}
- uses: actions/setup-python@v4
- 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-latest, windows-latest, ubuntu-latest]
- steps:
- - name: Download built action
- uses: actions/download-artifact@v3
- with:
- name: built-action
- - name: Test action with Python ${{ inputs.python-version }}
- id: build
- uses: ./
- with:
- python-version: ${{ inputs.python-version }}
- allow-build: force
- cache-build: true
- allow-prereleases: ${{ inputs.allow-prereleases }}
- - name: Setup Python ${{ inputs.python-version }}
- uses: actions/setup-python@v4
- 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
|