8000 add graalpy test workflow · actions/setup-python@41efa4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 41efa4a

Browse files
committed
add graalpy test workflow
1 parent 6d636b5 commit 41efa4a

File tree

1 file changed

+118
-0
lines changed

1 file changed

+118
-0
lines changed

.github/workflows/test-graalpy.yml

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
name: Validate GraalPy e2e
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
- '**.md'
9+
pull_request:
10+
paths-ignore:
11+
- '**.md'
12+
schedule:
13+
- cron: 30 3 * * *
14+
15+
jobs:
16+
setup-graalpy:
17+
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }}
18+
runs-on: ${{ matrix.os }}
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [macos-latest, ubuntu-20.04, ubuntu-latest]
23+
graalpy:
24+
- 'graalpy-23.0'
25+
- 'graalpy-22.3'
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v3
30+
31+
- name: setup-python ${{ matrix.graalpy }}
32+
id: setup-python
33+
uses: ./
34+
with:
35+
python-version: ${{ matrix.graalpy }}
36+
37+
- name: Check python-path
38+
run: ./__tests__/check-python-path.sh '${{ steps.setup-python.outputs.python-path }}'
39+
shell: bash
40+
41+
- name: GraalPy and Python version
42+
run: python --version
43+
44+
- name: Run simple code
45+
run: python -c 'import math; print(math.factorial(5))'
46+
47+
- name: Assert GraalPy is running
48+
run: |
49+
import platform
50+
assert platform.python_implementation().lower() == "graalvm"
51+
shell: python
52+
53+
- name: Assert expected binaries (or symlinks) are present
54+
run: |
55+
EXECUTABLE=${{ matrix.graalpy }}
56+
EXECUTABLE=${EXECUTABLE/graalpy-/graalpy} # remove the first '-' in "graalpy-X.Y" -> "graalpyX.Y" to match executable name
57+
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
58+
${EXECUTABLE} --version
59+
shell: bash
60+
61+
setup-graalpy-noenv:
62+
name: Setup GraalPy ${{ matrix.graalpy }} ${{ matrix.os }} (noenv)
63+
runs-on: ${{ matrix.os }}
64+
strategy:
65+
fail-fast: false
66+
matrix:
67+
os: [macos-latest, ubuntu-20.04, ubuntu-latest]
68+
graalpy: ['graalpy23.0', 'graalpy22.3']
69+
70+
steps:
71+
- name: Checkout
72+
uses: actions/checkout@v3
73+
74+
- name: setup-python ${{ matrix.graalpy }}
75+
id: setup-python
76+
uses: ./
77+
with:
78+
python-version: ${{ matrix.graalpy }}
79+
update-environment: false
80+
81+
- name: GraalPy and Python version
82+
run: ${{ steps.setup-python.outputs.python-path }} --version
83+
84+
- name: Run simple code
85+
run: ${{ steps.setup-python.outputs.python-path }} -c 'import math; print(math.factorial(5))'
86+
87+
check-latest:
88+
runs-on: ${{ matrix.os }}
89+
strategy:
90+
fail-fast: false
91+
matrix:
92+
os: [ubuntu-latest, macos-latest]
93+
steps:
94+
- uses: actions/checkout@v3
95+
- name: Setup GraalPy and check latest
96+
uses: ./
97+
with:
98+
python-version: 'graalpy-23.x'
99+
check-latest: true
100+
- name: GraalPy and Python version
101+
run: python --version
102+
103+
- name: Run simple code
104+
run: python -c 'import math; print(math.factorial(5))'
105+
106+
- name: Assert GraalPy is running
107+
run: |
108+
import platform
109+
assert platform.python_implementation().lower() == "graalvm"
110+
shell: python
111+
112+
- name: Assert expected binaries (or symlinks) are present
113+
run: |
114+
EXECUTABLE="graalpy-23.x"
115+
EXECUTABLE=${EXECUTABLE/-/} # remove the first '-' in "graalpy-X.Y" -> "graalpyX.Y" to match executable name
116+
EXECUTABLE=${EXECUTABLE%%-*} # remove any -* suffixe
117+
${EXECUTABLE} --version
118+
shell: bash

0 commit comments

Comments
 (0)
0