Skip to content

Commit 22f09b5

Browse files
authored
Merge pull request #45 from eoleedi/fix/ci
fix: Make Continuous Integration Work
2 parents b958338 + dd2c392 commit 22f09b5

5 files changed

Lines changed: 57 additions & 29 deletions

File tree

.github/workflows/continuous-integration-workflow.yml

Lines changed: 52 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,56 @@ name: CI
33
on: [push, pull_request]
44

55
jobs:
6-
build:
7-
8-
runs-on: ubuntu-latest
9-
6+
lint:
7+
name: Code Style Check
8+
runs-on: ubuntu-24.04-arm
9+
steps:
10+
- uses: actions/checkout@v4
11+
12+
- name: Set up Python 3.10
13+
uses: actions/setup-python@v5
14+
with:
15+
python-version: '3.10'
16+
cache: 'pip'
17+
18+
- name: Install YAPF
19+
run: |
20+
python -m pip install --upgrade pip
21+
pip install yapf
22+
23+
- name: Check code formatting
24+
run: yapf . -rd
25+
26+
test:
27+
name: Unit Tests
28+
runs-on: ubuntu-24.04-arm
1029
steps:
11-
- uses: actions/checkout@v1
12-
- name: Set up Python 3.7
13-
uses: actions/setup-python@v1
14-
with:
15-
python-version: 3.7
16-
- name: Upgrade pip
17-
run: |
18-
python -m pip install --upgrade pip
19-
- name: Install sandbox requirements
20-
run: |
21-
./build.sh
22-
pip install -r requirements.txt
23-
- name: YAPF
24-
run: |
25-
pip install yapf
26-
yapf . -rd
27-
- name: Unit test
28-
run: |
29-
pip install -r tests/requirements.txt
30-
pytest
30+
- uses: actions/checkout@v4
31+
32+
- name: Set up Python 3.10
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: '3.10'
36+
cache: 'pip'
37+
38+
- name: Cache build dependencies
39+
uses: actions/cache@v3
40+
with:
41+
path: ~/.cache/pip
42+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt', '**/tests/requirements.txt') }}
43+
restore-keys: |
44+
${{ runner.os }}-pip-
45+
46+
- name: Upgrade pip
47+
run: python -m pip install --upgrade pip
48+
49+
- name: Build sandbox
50+
run: ./build.sh
51+
52+
- name: Install dependencies
53+
run: |
54+
pip install -r requirements.txt
55+
pip install -r tests/requirements.txt
56+
57+
- name: Run tests
58+
run: pytest -v

c_cpp_dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# for c_cpp
22

3-
FROM ubuntu:20.04
3+
FROM ubuntu:22.04
44

55
LABEL org.opencontainers.image.authors="Normal-OJ Maintainers <admin@noj.tw>"
66

dispatcher/config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
)
1414
TESTDATA_ROOT = Path(os.getenv(
1515
'TESTDATA_ROOT',
16-
'/sandbox-testdata',
16+
'sandbox-testdata',
1717
))
1818
TESTDATA_ROOT.mkdir(exist_ok=True)
1919
SUBMISSION_DIR = Path(os.getenv(

python3_dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# for python3
22

3-
FROM ubuntu:18.04
3+
FROM ubuntu:22.04
44

55
LABEL org.opencontainers.image.authors="Normal-OJ Maintainers <admin@noj.tw>"
66

tests/test_submission_runner.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626
],
2727
)
2828
def test_strip_func(TestSubmissionRunner, stdout, answer, excepted):
29-
assert (TestSubmissionRunner.strip(stdout)
30-
== TestSubmissionRunner.strip(answer)) is excepted
29+
assert (TestSubmissionRunner.strip(stdout) == TestSubmissionRunner.strip(
30+
answer)) is excepted
3131

3232

3333
def test_c_tle(submission_generator, TestSubmissionRunner):

0 commit comments

Comments
 (0)