check.yml 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. name: Check specific version
  2. on:
  3. workflow_dispatch:
  4. inputs:
  5. python-version:
  6. required: true
  7. description: Specific version to check
  8. type: string
  9. allow-prereleases:
  10. required: true
  11. default: false
  12. description: Include prereleases in the check
  13. type: boolean
  14. env:
  15. NODE_VERSION: 16
  16. jobs:
  17. build:
  18. runs-on: ubuntu-latest
  19. name: Test build
  20. steps:
  21. - name: Checkout code
  22. uses: actions/checkout@v3
  23. with:
  24. submodules: recursive
  25. - name: Setup NodeJS ${{ env.NODE_VERSION }}
  26. uses: actions/setup-node@v3
  27. with:
  28. node-version: ${{ env.NODE_VERSION }}
  29. - name: Install dependencies
  30. run: npm ci
  31. - name: Build Typescript
  32. run: npm run build
  33. - name: Package with NCC
  34. run: npm run package
  35. - name: Upload built action
  36. uses: actions/upload-artifact@v3
  37. with:
  38. name: built-action
  39. path: |
  40. dist/index.js
  41. .github/
  42. action.yml
  43. retention-days: 1
  44. if-no-files-found: error
  45. test_python_build:
  46. needs: build
  47. runs-on: ${{ matrix.os }}
  48. name: Test build Python ${{ inputs.python-version }} for ${{ matrix.os }}
  49. strategy:
  50. fail-fast: false
  51. matrix:
  52. os: [macos-latest, windows-latest, ubuntu-latest]
  53. steps:
  54. - name: Download built action
  55. uses: actions/download-artifact@v3
  56. with:
  57. name: built-action
  58. - name: Test action with Python ${{ inputs.python-version }}
  59. id: build
  60. uses: ./
  61. with:
  62. python-version: ${{ inputs.python-version }}
  63. allow-build: force
  64. cache-build: true
  65. allow-prereleases: ${{ inputs.allow-prereleases }}
  66. - name: Setup Python ${{ inputs.python-version }}
  67. uses: actions/setup-python@v4
  68. id: setup
  69. with:
  70. python-version: ${{ steps.build.outputs.python-version }}
  71. architecture: ${{ steps.build.outputs.architecture }}
  72. - name: Setup pip
  73. run: ./.github/scripts/setup_pip.ps1
  74. shell: pwsh
  75. env:
  76. PYTHON_VERSION: ${{ steps.setup.outputs.python-version }}
  77. - name: Install numpy
  78. run: pip install numpy
  79. - name: Check Python version
  80. run: python ./.github/scripts/check_python_version.py ${{ inputs.python-version }}
  81. - name: Check strict Python version
  82. run: python ./.github/scripts/check_python_version.py ${{ steps.build.outputs.python-version }}
  83. - name: Check Python structure
  84. run: python ./.github/scripts/check_python_structure.py
  85. test_python_cache:
  86. needs: test_python_build
  87. runs-on: ${{ matrix.os }}
  88. name: Test cache Python ${{ inputs.python-version }} for ${{ matrix.os }}
  89. strategy:
  90. fail-fast: false
  91. matrix:
  92. os: [macos-latest, windows-latest, ubuntu-latest]
  93. steps:
  94. - name: Download built action
  95. uses: actions/download-artifact@v3
  96. with:
  97. name: built-action
  98. - name: Test action with Python ${{ inputs.python-version }}
  99. id: build
  100. uses: ./
  101. with:
  102. python-version: ${{ inputs.python-version }}
  103. allow-build: force
  104. cache-build: true
  105. allow-prereleases: ${{ inputs.allow-prereleases }}
  106. - name: Setup Python ${{ inputs.python-version }}
  107. uses: actions/setup-python@v4
  108. id: setup
  109. with:
  110. python-version: ${{ steps.build.outputs.python-version }}
  111. architecture: ${{ steps.build.outputs.architecture }}
  112. - name: Setup pip
  113. run: ./.github/scripts/setup_pip.ps1
  114. shell: pwsh
  115. env:
  116. PYTHON_VERSION: ${{ steps.setup.outputs.python-version }}
  117. - name: Install numpy
  118. run: pip install numpy
  119. - name: Check Python version
  120. run: python ./.github/scripts/check_python_version.py ${{ inputs.python-version }}
  121. - name: Check strict Python version
  122. run: python ./.github/scripts/check_python_version.py ${{ steps.build.outputs.python-version }}
  123. - name: Check Python structure
  124. run: python ./.github/scripts/check_python_structure.py