Skip to content
This repository has been archived by the owner on Sep 5, 2024. It is now read-only.

CI: PyPy

CI: PyPy #31

Workflow file for this run

name: Rime
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: |
pypy3.10
3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Enumerate Problems
run: |
problems=$(ls -d */ | grep -v _common | tr -d '/' | tr ' ' '\n' | sort -bdfu)
echo $problems | tr ' ' '\n'
{
echo 'problems<<EOF'
echo $problems | tr ' ' '\n'
echo EOF
} >> "$GITHUB_ENV"
- name: Cache Rime
uses: actions/cache@v4
with:
path: ./*/rime-out/**
key: rime
- name: Run Tests
run: |
for prob in $problems; do
echo ::group::$prob
for pyfile in $prob/**/*.py; do
if grep -q 'pypy' $pyfile; then
echo "Compiling $pyfile with PyPy..."
pypy -m py_compile $pyfile
else
echo "Compiling $pyfile with CPython..."
python -m py_compile $pyfile
fi
done
echo "Running Rime..."
rime test $prob
echo ::endgroup::
done