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

Commit

Permalink
CI: PyPy (#20)
Browse files Browse the repository at this point in the history
* ci: pypy setup

* debug

* debug 2

* debug 3

* test

* test 2

* fix

* fix 2

* test 3

* upd

* test 4

* test 5

* test 6

* test 7

* upd 2

* upd 3

* upd 4

* debug

* debug 2

* debug 3
  • Loading branch information
a01sa01to authored Jul 27, 2024
1 parent c60b704 commit f126851
Show file tree
Hide file tree
Showing 9 changed files with 61 additions and 5 deletions.
26 changes: 21 additions & 5 deletions .github/workflows/rime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
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 "::group::Check Files"
echo $problems | tr ' ' '\n'
echo "::endgroup::"
{
echo 'problems<<EOF'
echo $problems | tr ' ' '\n'
Expand All @@ -40,7 +40,23 @@ jobs:
- name: Run Tests
run: |
for prob in $problems; do
echo ::group::$prob
rime test $prob
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions three-coins/sol-pypy-ac/SOLUTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8; mode: python -*-
script_solution(src='main.py')
expected_score(100)
17 changes: 17 additions & 0 deletions three-coins/sol-pypy-ac/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env pypy

n = int(input())
a = set(list(map(int, input().split())))

s = set()

for x in a:
for y in a:
for z in a:
s.add(x + y + z)

ans = 0
for x in s:
ans ^= x

print(ans)
3 changes: 3 additions & 0 deletions three-coins/sol-pypy-partial1/SOLUTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# -*- coding: utf-8; mode: python -*-
script_solution(src='main.py', challenge_cases=["*_all.in"])
expected_score(1)
17 changes: 17 additions & 0 deletions three-coins/sol-pypy-partial1/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env pypy

n = int(input())
a = list(map(int, input().split()))

s = set()

for x in a:
for y in a:
for z in a:
s.add(x + y + z)

ans = 0
for x in s:
ans ^= x

print(ans)

0 comments on commit f126851

Please sign in to comment.