Skip to content

Commit 4df414a

Browse files
committed
github actions
1 parent c45653c commit 4df414a

File tree

3 files changed

+147
-1
lines changed

3 files changed

+147
-1
lines changed

.github/workflows/backend-ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
on: [push, pull_request]
2+
3+
name: Backend Continuous Integration
4+
5+
defaults:
6+
run:
7+
shell: bash
8+
working-directory: ./optimal-settings-backend
9+
10+
jobs:
11+
check:
12+
name: Check
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
17+
18+
- name: Install stable toolchain
19+
uses: actions-rs/toolchain@v1
20+
with:
21+
profile: minimal
22+
toolchain: stable
23+
override: true
24+
25+
- name: Run cargo check
26+
uses: actions-rs/cargo@v1
27+
with:
28+
command: check
29+
30+
test:
31+
name: Test
32+
runs-on: ubuntu-22.04
33+
steps:
34+
- name: Checkout sources
35+
uses: actions/checkout@v4
36+
37+
- name: Install stable toolchain
38+
uses: actions-rs/toolchain@v1
39+
with:
40+
profile: minimal
41+
toolchain: stable
42+
override: true
43+
44+
- name: Run cargo test
45+
uses: actions-rs/cargo@v1
46+
with:
47+
command: test
48+
49+
lints:
50+
name: Lints
51+
runs-on: ubuntu-22.04
52+
steps:
53+
- name: Checkout sources
54+
uses: actions/checkout@v4
55+
56+
- name: Install stable toolchain
57+
uses: actions-rs/toolchain@v1
58+
with:
59+
profile: minimal
60+
toolchain: stable
61+
override: true
62+
components: rustfmt, clippy
63+
64+
- name: Run cargo fmt
65+
uses: actions-rs/cargo@v1
66+
with:
67+
command: fmt
68+
args: --all -- --check
69+
70+
- name: Run cargo clippy
71+
uses: actions-rs/cargo@v1
72+
with:
73+
command: clippy
74+
args: -- -D warnings
75+
76+
build:
77+
name: Backend Build
78+
needs: [check, test]
79+
runs-on: ubuntu-22.04
80+
steps:
81+
- name: Checkout sources
82+
uses: actions/checkout@v4
83+
84+
- name: Install stable toolchain
85+
uses: actions-rs/toolchain@v1
86+
with:
87+
profile: minimal
88+
toolchain: stable
89+
override: true
90+
91+
- name: Run cargo build
92+
uses: actions-rs/cargo@v1
93+
with:
94+
command: build
95+
args: --release
96+

.github/workflows/frontend-ci.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
on: [push, pull_request]
2+
3+
name: Frontend Continuous Integration
4+
5+
defaults:
6+
run:
7+
shell: bash
8+
working-directory: ./optimal-settings-frontend
9+
10+
jobs:
11+
lints:
12+
name: Lints
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- name: Checkout sources
16+
uses: actions/checkout@v4
17+
18+
- name: Use Node.js
19+
uses: actions/setup-node@v3
20+
with:
21+
node-version: '20.x'
22+
23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Run lints
27+
run: npm run lint
28+
29+
- name: Run prettier check
30+
run: npm run check-format
31+
32+
build:
33+
name: Build
34+
runs-on: ubuntu-22.04
35+
steps:
36+
- name: Checkout sources
37+
uses: actions/checkout@v4
38+
39+
- name: Use Node.js
40+
uses: actions/setup-node@v3
41+
with:
42+
node-version: '20.x'
43+
44+
- name: Install dependencies
45+
run: npm ci
46+
47+
- name: Run build
48+
run: npm run build
49+

optimal-settings-frontend/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"build": "next build",
88
"start": "next start",
99
"lint": "next lint",
10-
"format": "prettier --write ."
10+
"check-format": "prettier . --check",
11+
"format": "prettier . --write"
1112
},
1213
"dependencies": {
1314
"@mdx-js/loader": "^3.0.0",

0 commit comments

Comments
 (0)