-
Notifications
You must be signed in to change notification settings - Fork 3
138 lines (135 loc) · 4.38 KB
/
check.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
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