-
Notifications
You must be signed in to change notification settings - Fork 0
111 lines (91 loc) · 2.66 KB
/
Copy pathci.yml
File metadata and controls
111 lines (91 loc) · 2.66 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
name: CI
on:
push:
branches: [ "main", "master" ]
pull_request:
branches: [ "main", "master" ]
env:
CARGO_TERM_COLOR: always
SQLX_OFFLINE: true
jobs:
backend:
name: Backend (Rust)
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15-alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
POSTGRES_DB: payego
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
components: clippy, rustfmt
- name: Cache Cargo registry
uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: sudo apt-get update && sudo apt-get install -y libpq-dev openssl libssl-dev pkg-config
- name: Install diesel_cli
run: |
if ! command -v diesel &> /dev/null; then
cargo install diesel_cli --no-default-features --features postgres
fi
- name: Install cargo-audit
run: |
if ! command -v cargo-audit &> /dev/null; then
cargo install cargo-audit
fi
- name: Check Formatting
run: cargo fmt --all -- --check
- name: Linting
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
- name: Run Tests
env:
DATABASE_URL: postgres://postgres:password@localhost:5432/payego
TEST_DATABASE_URL: postgres://postgres:password@localhost:5432/payego
APP_ENV: test
JWT_SECRET: super_secret_testing_key_must_be_long_enough
RUST_LOG: info
run: cargo test --workspace
- name: Security Audit
run: cargo audit
frontend:
name: Frontend (React)
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./payego_ui
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18'
cache: 'npm'
cache-dependency-path: payego_ui/package-lock.json
- name: Install Dependencies
run: npm ci
- name: Lint
run: npm run lint
- name: Test
run: npm run test
- name: Build
run: npm run build