-
Notifications
You must be signed in to change notification settings - Fork 12
144 lines (120 loc) · 4.23 KB
/
frontend-ci.yml
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
136
137
138
139
140
141
142
143
144
name: CI for frontend
on:
pull_request:
push:
branches:
- master
schedule:
- cron: "0 0 * * *"
jobs:
lint-type-check:
defaults:
run:
working-directory: web
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16 # TODO: use latest version when we update to Vue 3
- name: Install Vue app
run: yarn install
- name: Lint Vue app
run: yarn run lint --no-fix
- name: Type-check Vue app
run: yarn run type-check
- name: Build Vue app
run: yarn run build
test-e2e:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:latest
env:
POSTGRES_DB: django
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
rabbitmq:
image: rabbitmq:management
ports:
- 5672:5672
minio:
# This image does not require any command arguments (which GitHub Actions don't support)
image: bitnami/minio:latest
env:
MINIO_ROOT_USER: minioAccessKey
MINIO_ROOT_PASSWORD: minioSecretKey
ports:
- 9000:9000
env:
# API server env vars
DJANGO_DATABASE_URL: postgres://postgres:postgres@localhost:5432/django
DJANGO_MINIO_STORAGE_ENDPOINT: localhost:9000
DJANGO_MINIO_STORAGE_ACCESS_KEY: minioAccessKey
DJANGO_MINIO_STORAGE_SECRET_KEY: minioSecretKey
DJANGO_STORAGE_BUCKET_NAME: dandi-bucket
DJANGO_DANDI_DANDISETS_BUCKET_NAME: dandi-bucket
DJANGO_DANDI_DANDISETS_LOG_BUCKET_NAME: dandiapi-dandisets-logs
DJANGO_DANDI_DANDISETS_EMBARGO_BUCKET_NAME: dandi-embargo-dandisets
DJANGO_DANDI_DANDISETS_EMBARGO_LOG_BUCKET_NAME: dandiapi-embargo-dandisets-logs
DJANGO_DANDI_WEB_APP_URL: http://localhost:8085
DJANGO_DANDI_API_URL: http://localhost:8000
DJANGO_DANDI_JUPYTERHUB_URL: https://hub.dandiarchive.org/
DANDI_ALLOW_LOCALHOST_URLS: 1
# Web client env vars
VITE_APP_DANDI_API_ROOT: http://localhost:8000/api/
VITE_APP_OAUTH_API_ROOT: http://localhost:8000/oauth/
VITE_APP_OAUTH_CLIENT_ID: Dk0zosgt1GAAKfN8LT4STJmLJXwMDPbYWYzfNtAl
# E2E tests env vars
CLIENT_URL: http://localhost:8085
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
cache: 'yarn'
cache-dependency-path: web/yarn.lock
- name: Install web app
if: steps.yarn-cache.outputs.cache-hit != 'true'
run: yarn install --frozen-lockfile --prefer-offline
working-directory: web
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Install latest version of pip
run: pip install --upgrade pip
- uses: actions/cache@v4
id: pip-cache
with:
path: ${{ env.pythonLocation}}/lib/python3.11/site-packages/*
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('setup.py') }}
- name: Install dandi-api dependencies
run: pip install --upgrade --upgrade-strategy eager -e .[dev]
- name: Apply migrations to API server
run: python manage.py migrate
- name: Create any cache tables
run: python manage.py createcachetable
# Populate the database with a dandiset for FileBrowser tests
- name: Create a superuser
run: python manage.py createsuperuser --noinput --email [email protected]
- name: Create Dandiset
run: python manage.py create_dev_dandiset --owner [email protected]
- name: Install E2E tests
run: yarn install --frozen-lockfile
working-directory: e2e
- name: Lint E2E tests
run: yarn run lint --no-fix --max-warnings=0
working-directory: e2e
- name: Run E2E tests
run: |
# start vue dev server and wait for it to start
yarn --cwd ../web/ run dev 2> /dev/null &
while ! nc -z localhost 8085; do
sleep 3
done
# start the dandi-api server
python ../manage.py runserver &
# run the E2E tests
yarn run test
working-directory: e2e