-
Notifications
You must be signed in to change notification settings - Fork 2
135 lines (135 loc) · 3.71 KB
/
ci.yml
File metadata and controls
135 lines (135 loc) · 3.71 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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
if: ${{ always() && github.event_name == 'pull_request' }}
needs:
- clippy
- eslint
- mypy
- pre-commit
- pytest
- rustfmt
- tsc
- udeps
runs-on: ubuntu-24.04
steps:
- uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
clippy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: beta
components: clippy
- run: cargo +beta clippy -- -Dwarnings
working-directory: ./socnet_rs
eslint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
check-latest: true
- run: npm ci
- run: npx eslint --max-warnings 0 .
mypy:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- run: cp .env.example .env
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv run --extra local --locked mypy .
pre-commit:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: astral-sh/setup-uv@v7
with:
enable-cache: false
- run: uv tool run --no-cache --python 3.14 prek run --all-files --show-diff-on-failure
env:
RUFF_OUTPUT_FORMAT: github
pytest:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: docker/setup-buildx-action@v4
- id: build
uses: docker/build-push-action@v7
with:
build-args: EXTRA=local
cache-from: type=gha
cache-to: type=gha,mode=max
file: ./docker/django/Dockerfile
load: true
tags: socnet-ci-django
target: python-ci
- run: cp .env.example .env
- run: docker compose -f compose.yaml -f compose.ci.yaml run --rm django python3 manage.py migrate
- run: docker compose -f compose.yaml -f compose.ci.yaml run --rm django pytest --cov
- if: ${{ always() && steps.build.conclusion == 'success' }}
run: docker compose -f compose.yaml -f compose.ci.yaml down --remove-orphans
rustfmt:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
components: rustfmt
- run: cargo +nightly fmt --check
working-directory: ./socnet_rs
tsc:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions/setup-node@v6
with:
node-version-file: .nvmrc
cache: npm
check-latest: true
- run: npm ci
- run: npx tsc --build --noEmit
udeps:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v6
with:
persist-credentials: false
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: nightly
cache-key: x86_64-unknown-linux-gnu
- run: cargo +nightly install --locked cargo-udeps
- run: cargo +nightly udeps
working-directory: ./socnet_rs