Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 52 additions & 24 deletions .github/workflows/continuous-integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,56 @@ name: CI
on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-latest

lint:
name: Code Style Check
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Install YAPF
run: |
python -m pip install --upgrade pip
pip install yapf

- name: Check code formatting
run: yapf . -rd

test:
name: Unit Tests
runs-on: ubuntu-24.04-arm
steps:
- uses: actions/checkout@v1
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
- name: Install sandbox requirements
run: |
./build.sh
pip install -r requirements.txt
- name: YAPF
run: |
pip install yapf
yapf . -rd
- name: Unit test
run: |
pip install -r tests/requirements.txt
pytest
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v5
with:
python-version: '3.10'
cache: 'pip'

- name: Cache build dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/tests/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-

- name: Upgrade pip
run: python -m pip install --upgrade pip

- name: Build sandbox
run: ./build.sh

- name: Install dependencies
run: |
pip install -r requirements.txt
pip install -r tests/requirements.txt

- name: Run tests
run: pytest -v
2 changes: 1 addition & 1 deletion c_cpp_dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# for c_cpp

FROM ubuntu:20.04
FROM ubuntu:22.04

LABEL org.opencontainers.image.authors="Normal-OJ Maintainers <[email protected]>"

Expand Down
2 changes: 1 addition & 1 deletion dispatcher/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
)
TESTDATA_ROOT = Path(os.getenv(
'TESTDATA_ROOT',
'/sandbox-testdata',
'sandbox-testdata',
))
TESTDATA_ROOT.mkdir(exist_ok=True)
SUBMISSION_DIR = Path(os.getenv(
Expand Down
2 changes: 1 addition & 1 deletion python3_dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# for python3

FROM ubuntu:18.04
FROM ubuntu:22.04

LABEL org.opencontainers.image.authors="Normal-OJ Maintainers <[email protected]>"

Expand Down
4 changes: 2 additions & 2 deletions tests/test_submission_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
],
)
def test_strip_func(TestSubmissionRunner, stdout, answer, excepted):
assert (TestSubmissionRunner.strip(stdout)
== TestSubmissionRunner.strip(answer)) is excepted
assert (TestSubmissionRunner.strip(stdout) == TestSubmissionRunner.strip(
answer)) is excepted


def test_c_tle(submission_generator, TestSubmissionRunner):
Expand Down