2021-01-02 10:50:16 +00:00
|
|
|
name: linkding CI
|
|
|
|
|
2024-03-17 08:59:04 +00:00
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
2021-01-02 10:50:16 +00:00
|
|
|
|
|
|
|
jobs:
|
2023-01-21 23:47:47 +00:00
|
|
|
unit_tests:
|
|
|
|
name: Unit Tests
|
2021-01-02 10:50:16 +00:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-16 14:57:23 +00:00
|
|
|
- uses: actions/checkout@v4
|
2021-01-02 10:50:16 +00:00
|
|
|
- name: Set up Python
|
2024-03-16 14:57:23 +00:00
|
|
|
uses: actions/setup-python@v5
|
2021-01-02 10:50:16 +00:00
|
|
|
with:
|
2024-09-19 17:38:03 +00:00
|
|
|
python-version: "3.12"
|
2021-05-14 00:38:44 +00:00
|
|
|
- name: Set up Node
|
2024-03-16 14:57:23 +00:00
|
|
|
uses: actions/setup-node@v4
|
2021-05-14 00:38:44 +00:00
|
|
|
with:
|
2024-03-16 14:57:23 +00:00
|
|
|
node-version: 20
|
|
|
|
cache: 'npm'
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Install Node dependencies
|
2024-03-16 14:57:23 +00:00
|
|
|
run: npm ci
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Setup Python environment
|
2024-04-07 09:11:14 +00:00
|
|
|
run: |
|
|
|
|
pip install -r requirements.txt -r requirements.dev.txt
|
|
|
|
mkdir data
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Run tests
|
|
|
|
run: python manage.py test bookmarks.tests
|
|
|
|
e2e_tests:
|
|
|
|
name: E2E Tests
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2024-03-16 14:57:23 +00:00
|
|
|
- uses: actions/checkout@v4
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Set up Python
|
2024-03-16 14:57:23 +00:00
|
|
|
uses: actions/setup-python@v5
|
2023-01-21 23:47:47 +00:00
|
|
|
with:
|
2024-09-19 17:38:03 +00:00
|
|
|
python-version: "3.12"
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Set up Node
|
2024-03-16 14:57:23 +00:00
|
|
|
uses: actions/setup-node@v4
|
2023-01-21 23:47:47 +00:00
|
|
|
with:
|
2024-03-16 14:57:23 +00:00
|
|
|
node-version: 20
|
|
|
|
cache: 'npm'
|
2021-05-14 00:38:44 +00:00
|
|
|
- name: Install Node dependencies
|
2024-03-16 14:57:23 +00:00
|
|
|
run: npm ci
|
2023-01-21 23:47:47 +00:00
|
|
|
- name: Setup Python environment
|
|
|
|
run: |
|
2024-01-28 21:50:51 +00:00
|
|
|
pip install -r requirements.txt -r requirements.dev.txt
|
2023-01-21 23:47:47 +00:00
|
|
|
playwright install chromium
|
2024-04-07 09:11:14 +00:00
|
|
|
mkdir data
|
2023-08-21 21:12:00 +00:00
|
|
|
- name: Run build
|
|
|
|
run: |
|
|
|
|
npm run build
|
2024-09-13 21:19:47 +00:00
|
|
|
python manage.py collectstatic
|
2021-01-02 10:50:16 +00:00
|
|
|
- name: Run tests
|
2023-05-21 12:32:24 +00:00
|
|
|
run: python manage.py test bookmarks.e2e --pattern="e2e_test_*.py"
|