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

問題: Three Coins #53

問題: Three Coins

問題: Three Coins #53

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 "$prob"
for pyfile in $prob/**/*.py; do
if grep -q 'pypy' $pyfile; then
echo "::group::Compile $pyfile with PyPy"
pypy -m py_compile $pyfile
echo "::endgroup::"
else
echo "::group::Compile $pyfile with CPython"
python -m py_compile $pyfile
echo "::endgroup::"
fi
done
echo "::group::Build"
rime build -k -j 2 -C -p $prob
echo "::endgroup::"
echo "::group::Test"
rime test -k -j 2 -C -p $prob
echo ::endgroup::
echo ""
done