Skip to content

Commit 4885873

Browse files
authored
Merge pull request #1218 from kenkoooo/pr/hotate29/1212
merge #1212
2 parents b0ee968 + a9688ea commit 4885873

File tree

1 file changed

+58
-59
lines changed

1 file changed

+58
-59
lines changed

.github/workflows/ci.yml

Lines changed: 58 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ name: CI
22

33
on:
44
push:
5-
branches: [ master ]
5+
branches: [master]
66
pull_request:
77

88
env:
99
CARGO_TERM_COLOR: always
1010
RUST_BACKTRACE: 1
1111
RUST_TEST_THREADS: 1
12+
CARGO_PROFILE_TEST_DEBUG: 0
1213
SQL_URL: postgres://db_user:db_pass@localhost:5432/test_db
1314

1415
jobs:
@@ -36,33 +37,31 @@ jobs:
3637
- 5432:5432
3738

3839
steps:
39-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v2
4041

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') }}
42+
- name: Cache dependencies
43+
uses: Swatinem/[email protected]
44+
with:
45+
working-directory: ./atcoder-problems-backend
5046

51-
- name: Setup Postgresql
52-
run: psql ${SQL_URL} < ../config/database-definition.sql
47+
- name: Setup Postgresql
48+
run: psql ${SQL_URL} < ../config/database-definition.sql
5349

54-
- name: Setup
55-
run: rustup component add rustfmt
50+
- name: Setup
51+
run: rustup component add rustfmt
5652

57-
- name: Check format
58-
run: cargo fmt --all -- --check
53+
- name: Check format
54+
run: cargo fmt --all -- --check
5955

60-
- name: Build
61-
run: cargo build --verbose
56+
- name: Download dependencies
57+
run: cargo fetch --locked
58+
59+
- name: Build
60+
run: cargo test --no-run --workspace --locked --verbose
61+
62+
- name: Run tests
63+
run: cargo test --workspace --locked --verbose -- --test-threads=1
6264

63-
- name: Run tests
64-
run: cargo test --verbose --workspace -- --test-threads=1
65-
6665
frontend_test:
6766
name: Run frontend tests
6867
runs-on: ubuntu-latest
@@ -71,40 +70,40 @@ jobs:
7170
working-directory: ./atcoder-problems-frontend
7271

7372
steps:
74-
- uses: actions/checkout@v2
75-
- name: Use Node.js
76-
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-
86-
- name: Cache cargo registry
87-
uses: actions/cache@v2
88-
with:
89-
path: |
90-
~/.cargo/git
91-
~/.cargo/registry/cache
92-
~/.cargo/registry/index
93-
./atcoder-problems-backend/target
94-
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-backend/Cargo.lock') }}
95-
96-
- name: Install dependencies
97-
run: yarn
98-
- name: Setup mdBook
99-
run: cargo install mdbook
100-
- name: build
101-
run: yarn build
102-
- name: test
103-
run: yarn test
104-
- name: lint
105-
run: yarn lint
106-
- name: Integration test
107-
run: |
108-
yarn prepare-ci
109-
yarn start:ci &
110-
yarn cy:run
73+
- uses: actions/checkout@v2
74+
- name: Use Node.js
75+
uses: actions/setup-node@v1
76+
77+
- name: Cache node_modules
78+
uses: actions/cache@v2
79+
with:
80+
path: |
81+
~/.cache/Cypress
82+
./atcoder-problems-frontend/node_modules
83+
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-frontend/yarn.lock') }}
84+
85+
- name: Cache cargo registry
86+
uses: actions/cache@v2
87+
with:
88+
path: |
89+
~/.cargo/git
90+
~/.cargo/registry/cache
91+
~/.cargo/registry/index
92+
./atcoder-problems-backend/target
93+
key: ${{ runner.os }}-cargo-${{ hashFiles('atcoder-problems-backend/Cargo.lock') }}
94+
95+
- name: Install dependencies
96+
run: yarn
97+
- name: Setup mdBook
98+
run: cargo install mdbook
99+
- name: build
100+
run: yarn build
101+
- name: test
102+
run: yarn test
103+
- name: lint
104+
run: yarn lint
105+
- name: Integration test
106+
run: |
107+
yarn prepare-ci
108+
yarn start:ci &
109+
yarn cy:run

0 commit comments

Comments
 (0)