Skip to content

Commit 8b286cc

Browse files
Merge branch 'master' of https://github.com/polyester-CTRL/AtCoderProblems into feature/993
2 parents d856f3d + f751354 commit 8b286cc

File tree

95 files changed

+5395
-5174
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+5395
-5174
lines changed

.github/workflows/ci.yml

Lines changed: 41 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -9,68 +9,89 @@ env:
99
CARGO_TERM_COLOR: always
1010
RUST_BACKTRACE: 1
1111
RUST_TEST_THREADS: 1
12+
SQL_URL: postgres://db_user:db_pass@localhost:5432/test_db
1213

1314
jobs:
1415
backend_test:
1516
name: Run backend tests
1617
runs-on: ubuntu-latest
17-
18+
defaults:
19+
run:
20+
working-directory: ./atcoder-problems-backend
21+
1822
services:
19-
postgres:
23+
postgres:
2024
image: postgres
2125
env:
22-
POSTGRES_PASSWORD: pass
23-
POSTGRES_USER: kenkoooo
24-
POSTGRES_DB: test
25-
# Set health checks to wait until postgres has started
26+
POSTGRES_USER: db_user
27+
POSTGRES_PASSWORD: db_pass
28+
POSTGRES_DB: test_db
29+
POSTGRES_INITDB_ARGS: "--encoding=UTF8"
2630
options: >-
2731
--health-cmd pg_isready
2832
--health-interval 10s
2933
--health-timeout 5s
3034
--health-retries 5
3135
ports:
32-
# Maps tcp port 5432 on service container to the host
3336
- 5432:5432
34-
37+
3538
steps:
3639
- uses: actions/checkout@v2
40+
41+
- name: Cache cargo registry
42+
uses: actions/cache@v2
43+
with:
44+
path: |
45+
~/.cargo/git
46+
~/.cargo/registry/cache
47+
~/.cargo/registry/index
48+
./atcoder-problems-backend/target
49+
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-backend/Cargo.lock') }}
50+
51+
- name: Setup Postgresql
52+
run: psql ${SQL_URL} < ../config/database-definition.sql
53+
3754
- name: Setup
3855
run: rustup component add rustfmt
56+
3957
- name: Check format
40-
working-directory: ./atcoder-problems-backend
4158
run: cargo fmt --all -- --check
59+
4260
- name: Build
43-
working-directory: ./atcoder-problems-backend
4461
run: cargo build --verbose
62+
4563
- name: Run tests
46-
working-directory: ./atcoder-problems-backend
47-
env:
48-
SQL_URL: postgresql://kenkoooo:pass@localhost:5432/test
4964
run: cargo test --verbose --workspace -- --test-threads=1
5065

5166
frontend_test:
5267
name: Run frontend tests
5368
runs-on: ubuntu-latest
69+
defaults:
70+
run:
71+
working-directory: ./atcoder-problems-frontend
72+
5473
steps:
55-
- name: Setup
56-
run: sudo apt install libgconf-2-4
5774
- uses: actions/checkout@v2
5875
- name: Use Node.js
5976
uses: actions/setup-node@v1
77+
78+
- name: Cache node_modules
79+
uses: actions/cache@v2
80+
with:
81+
path: |
82+
~/.cache/Cypress
83+
./atcoder-problems-frontend/node_modules
84+
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-frontend/yarn.lock') }}
85+
6086
- name: Install dependencies
61-
working-directory: ./atcoder-problems-frontend
6287
run: yarn
6388
- name: build
64-
working-directory: ./atcoder-problems-frontend
6589
run: yarn build
6690
- name: test
67-
working-directory: ./atcoder-problems-frontend
6891
run: yarn test
6992
- name: lint
70-
working-directory: ./atcoder-problems-frontend
7193
run: yarn lint
7294
- name: Integration test
73-
working-directory: ./atcoder-problems-frontend
7495
run: |
7596
yarn prepare-ci
7697
yarn start:ci &

atcoder-problems-backend/.rustfmt.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)