forked from smarr/PySOM
-
Notifications
You must be signed in to change notification settings - Fork 3
92 lines (79 loc) · 3 KB
/
ci.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
name: Tests
on: [push, pull_request]
jobs:
test_som:
runs-on: ubuntu-20.04 # ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- name: AST Interpreter PyPy2
id: ast
interp: AST
python-version: pypy2.7
- name: Bytecode Interpreter PyPy2
id: bc
interp: BC
python-version: pypy2.7
- name: Basics PyPy 2.7
python-version: pypy2.7
id: basic
- name: Basics Python 3.11
python-version: 3.11
id: basic
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Set up PyPy
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Download PyPy Sources
if: matrix.id != 'basic'
run: |
export PYPYVER=v7.3.15
curl https://downloads.python.org/pypy/pypy2.7-${PYPYVER}-src.tar.bz2 -o pypy.tar.bz2
tar -xjf pypy.tar.bz2
mv pypy2.7-${PYPYVER}-src .pypy
- name: Install PyTest
run: |
pip install pytest
- name: Tests
if: matrix.id == 'basic'
run: |
export PYTHON=python
export PYTHONPATH=src
SOM_INTERP=AST pytest
SOM_INTERP=BC pytest
SOM_INTERP=AST ./som.sh -cp Smalltalk TestSuite/TestHarness.som
SOM_INTERP=BC ./som.sh -cp Smalltalk TestSuite/TestHarness.som
echo "[system exit: 0] value" | SOM_INTERP=AST ./som.sh -cp Smalltalk
echo "[system exit: 0] value" | SOM_INTERP=BC ./som.sh -cp Smalltalk
- name: Full Tests
if: matrix.id != 'basic'
run: |
export SOM_INTERP=${{ matrix.interp }}
PYTHONPATH=$PYTHONPATH:.pypy:src pytest
PYTHONPATH=$PYTHONPATH:.pypy ./som.sh -cp Smalltalk TestSuite/TestHarness.som
PYTHONPATH=$PYTHONPATH:.pypy .pypy/rpython/bin/rpython --batch src/main_rpython.py
./som-${{ matrix.id }}-interp -cp Smalltalk TestSuite/TestHarness.som
- name: SomSom Tests
if: matrix.id != 'basic'
run: |
./som-${{ matrix.id }}-interp -cp core-lib/Smalltalk:core-lib/TestSuite:core-lib/SomSom/src/compiler:core-lib/SomSom/src/vm:core-lib/SomSom/src/vmobjects:core-lib/SomSom/src/interpreter:core-lib/SomSom/src/primitives \
core-lib/SomSom/tests/SomSomTests.som
- name: Install and Run Black
run: |
pip install black
black --check --diff src tests
if: matrix.python-version == '3.11'
- name: Install and Run PyLint
run: |
pip install pylint
pylint --init-hook="import sys; sys.setrecursionlimit(2000)" src tests
if: matrix.python-version == '3.11'
concurrency:
group: "workflow = ${{ github.workflow }}, ref = ${{ github.event.ref }}, pr = ${{ github.event.pull_request.id }}"
cancel-in-progress: ${{ github.event_name == 'pull_request' }}