@@ -2,13 +2,14 @@ name: CI
2
2
3
3
on :
4
4
push :
5
- branches : [ master ]
5
+ branches : [master]
6
6
pull_request :
7
7
8
8
env :
9
9
CARGO_TERM_COLOR : always
10
10
RUST_BACKTRACE : 1
11
11
RUST_TEST_THREADS : 1
12
+ CARGO_PROFILE_TEST_DEBUG : 0
12
13
SQL_URL : postgres://db_user:db_pass@localhost:5432/test_db
13
14
14
15
jobs :
@@ -36,33 +37,31 @@ jobs:
36
37
- 5432:5432
37
38
38
39
steps :
39
- - uses : actions/checkout@v2
40
+ - uses : actions/checkout@v2
40
41
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
+
44
+ with :
45
+ working-directory : ./atcoder-problems-backend
50
46
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
53
49
54
- - name : Setup
55
- run : rustup component add rustfmt
50
+ - name : Setup
51
+ run : rustup component add rustfmt
56
52
57
- - name : Check format
58
- run : cargo fmt --all -- --check
53
+ - name : Check format
54
+ run : cargo fmt --all -- --check
59
55
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
62
64
63
- - name : Run tests
64
- run : cargo test --verbose --workspace -- --test-threads=1
65
-
66
65
frontend_test :
67
66
name : Run frontend tests
68
67
runs-on : ubuntu-latest
@@ -71,40 +70,40 @@ jobs:
71
70
working-directory : ./atcoder-problems-frontend
72
71
73
72
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