forked from cncf/gitjobs
-
Notifications
You must be signed in to change notification settings - Fork 0
85 lines (80 loc) · 2.65 KB
/
Copy pathci.yml
File metadata and controls
85 lines (80 loc) · 2.65 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
name: CI
on:
pull_request:
branches:
- main
jobs:
lint-and-test-server:
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Setup Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: 1.96.1
components: clippy, rustfmt
- name: Install Tailwind CSS
run: |
wget -O /usr/local/bin/tailwindcss https://github.com/tailwindlabs/tailwindcss/releases/download/v4.0.17/tailwindcss-linux-x64
chmod +x /usr/local/bin/tailwindcss
- name: Run clippy
run: cargo clippy --all-targets --all-features -- --deny warnings
- name: Run rustfmt
run: cargo fmt --all -- --check
- name: Run tests
run: cargo test
lint-templates:
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Install djlint
run: pip install djlint==1.36.4
- name: Run djlint
run: |
djlint \
--reformat \
--configuration gitjobs-server/templates/.djlintrc \
gitjobs-server/templates
check-js-files-format:
runs-on:
labels: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Run prettier
uses: creyD/prettier_action@v4.6
with:
dry: true
prettier_options: --check gitjobs-server/static/js/**/*.js --config gitjobs-server/static/js/.prettierrc.yaml
test-database:
runs-on:
labels: ubuntu-latest
permissions:
contents: read
packages: read
container: ghcr.io/cncf/gitjobs/db-tests
services:
postgres:
image: ghcr.io/cncf/gitjobs/postgres-db-tests
env:
POSTGRES_DB: tests
POSTGRES_PASSWORD: tests
POSTGRES_USER: tests
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Apply database migrations
working-directory: ./database/migrations
run: TERN_CONF=../../../.github/workflows/tern.conf PGPORT=${{ job.services.postgres.ports[5432] }} ./migrate.sh
- name: Install pgtap database extension
run: PGPASSWORD=tests psql -h postgres -p ${{ job.services.postgres.ports[5432] }} -U tests tests -c 'create extension pgtap;'
- name: Run database tests
working-directory: ./database/tests
run: PGPASSWORD=tests pg_prove --host postgres --dbname tests --username tests --verbose schema/*.sql functions/*/*.sql