-
Notifications
You must be signed in to change notification settings - Fork 4
110 lines (92 loc) · 2.74 KB
/
ci.yml
File metadata and controls
110 lines (92 loc) · 2.74 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
---
name: CI
on:
push:
branches:
- master
- release
- release-candidate
pull_request:
jobs:
python-tests:
runs-on: ubuntu-24.04
services:
db:
image: postgres:18.1
# Health checks to wait until postgres has started
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # pragma: allowlist secret
POSTGRES_DB: postgres
ports:
- 5432:5432
redis:
image: redis:8.4.0
ports:
- 6379:6379
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: update
run: sudo apt-get update -y
- name: Apt install
run: cat Aptfile | sudo xargs apt-get install
- name: Install uv
uses: astral-sh/setup-uv@37802adc94f370d6bfd71619e3f0bf239e1f3b78 # v7
with:
enable-cache: true
- name: Install Python
run: uv python install 3.13
- name: Install dependencies
run: uv sync --locked
- name: Tests
run: |
uv run ./manage.py check --fail-level WARNING
export MEDIA_ROOT="$(mktemp -d)"
sudo mkdir /var/media
sudo chown -R $USER:$USER /var/media
uv run ./scripts/test/python_tests.sh
env:
OCW_STUDIO_DB_DISABLE_SSL: "True"
OCW_STUDIO_SECURE_SSL_REDIRECT: "False"
CELERY_TASK_ALWAYS_EAGER: "True"
CELERY_BROKER_URL: redis://localhost:6379/4
CELERY_RESULT_BACKEND: redis://localhost:6379/4
DATABASE_URL: postgres://postgres:postgres@localhost:5432/postgres # pragma: allowlist secret
DEBUG: "False"
MAILGUN_SENDER_DOMAIN: "fake.example.com"
MAILGUN_KEY: "fake"
NODE_ENV: "production"
OCW_STUDIO_BASE_URL: "http://localhost:8043/"
SOCIAL_AUTH_SAML_LOGIN_URL: "fake.example.com/login/saml/"
SECRET_KEY: "secret" # pragma: allowlist secret
CONTENT_SYNC_BACKEND:
frontend-tests:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Setup NodeJS
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6
with:
node-version: 24
cache: yarn
- name: Install dependencies
run: yarn install --immutable
- name: Lints
run: npm run lint
- name: Code formatting
run: npm run fmt:check
- name: Scss lint
run: npm run scss_lint
- name: Typechecking
run: npm run typecheck
- name: Tests
run: npm run test:coverage
env:
NODE_ENV: development
- name: Webpack build
run: npm run build