2022-02-20 10:59:30 -07:00
|
|
|
# Use the latest 2.1 version of CircleCI pipeline process engine.
|
|
|
|
|
# See: https://circleci.com/docs/2.0/configuration-reference
|
|
|
|
|
version: 2.1
|
|
|
|
|
|
|
|
|
|
# Define a job to be invoked later in a workflow.
|
|
|
|
|
# See: https://circleci.com/docs/2.0/configuration-reference/#jobs
|
|
|
|
|
jobs:
|
2023-03-01 13:25:58 -07:00
|
|
|
api-tests-3-11:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cimg/python:3.11
|
2024-04-17 11:25:26 -06:00
|
|
|
- image: cimg/postgres:15.6
|
2023-03-01 13:25:58 -07:00
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
POSTGRES_DB: wrolpi
|
|
|
|
|
POSTGRES_PASSWORD: "wrolpi"
|
2024-02-27 18:54:14 -07:00
|
|
|
resource_class: medium
|
2023-03-01 13:25:58 -07:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- run: sudo apt-get update
|
2024-03-06 17:41:04 -07:00
|
|
|
- run: sudo apt-get install -y ffmpeg catdoc
|
2023-03-01 13:25:58 -07:00
|
|
|
- restore_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.11-{{ checksum "requirements.txt" }}-4
|
2023-03-01 13:25:58 -07:00
|
|
|
- run:
|
|
|
|
|
name: Install Requirements
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m venv venv
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
- save_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.11-{{ checksum "requirements.txt" }}-4
|
2023-03-01 13:25:58 -07:00
|
|
|
paths:
|
|
|
|
|
- "venv"
|
|
|
|
|
- run:
|
2024-05-07 10:50:06 -06:00
|
|
|
command: './venv/bin/pytest -svv --junitxml=test-results.xml'
|
|
|
|
|
- store_test_results:
|
|
|
|
|
path: test-results.xml
|
2024-08-15 21:45:06 -06:00
|
|
|
api-alembic-migrations:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cimg/python:3.11
|
|
|
|
|
- image: cimg/postgres:15.6
|
|
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: wrolpi
|
|
|
|
|
POSTGRES_DB: wrolpi
|
|
|
|
|
POSTGRES_PASSWORD: "wrolpi"
|
|
|
|
|
resource_class: medium
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.11-{{ checksum "requirements.txt" }}-4
|
2024-08-15 21:45:06 -06:00
|
|
|
- run:
|
|
|
|
|
name: Install Requirements
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m venv venv
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
- save_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.11-{{ checksum "requirements.txt" }}-4
|
2024-08-15 21:45:06 -06:00
|
|
|
paths:
|
|
|
|
|
- "venv"
|
|
|
|
|
- run:
|
|
|
|
|
command: ./venv/bin/python ./main.py db upgrade
|
2024-02-10 21:46:44 -07:00
|
|
|
api-tests-3-12:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cimg/python:3.12
|
2024-04-17 11:25:26 -06:00
|
|
|
- image: cimg/postgres:15.6
|
2024-02-10 21:46:44 -07:00
|
|
|
environment:
|
|
|
|
|
POSTGRES_USER: postgres
|
|
|
|
|
POSTGRES_DB: wrolpi
|
|
|
|
|
POSTGRES_PASSWORD: "wrolpi"
|
2024-02-27 18:54:14 -07:00
|
|
|
resource_class: medium
|
2024-02-10 21:46:44 -07:00
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- run: sudo apt-get update
|
2024-03-06 17:41:04 -07:00
|
|
|
- run: sudo apt-get install -y ffmpeg catdoc
|
2024-02-10 21:46:44 -07:00
|
|
|
- restore_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.12-{{ checksum "requirements.txt" }}-4
|
2024-02-10 21:46:44 -07:00
|
|
|
- run:
|
|
|
|
|
name: Install Requirements
|
|
|
|
|
command: |
|
|
|
|
|
python3 -m venv venv
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
- save_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.12-{{ checksum "requirements.txt" }}-4
|
2024-02-10 21:46:44 -07:00
|
|
|
paths:
|
|
|
|
|
- "venv"
|
|
|
|
|
- run:
|
2024-02-12 11:52:03 -07:00
|
|
|
command: './venv/bin/pytest -svv'
|
2024-05-07 10:09:56 -06:00
|
|
|
sanic-api-start:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cimg/python:3.11
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2024-09-15 15:33:07 -06:00
|
|
|
key: deps-3.11-{{ checksum "requirements.txt" }}-4
|
2024-05-07 10:09:56 -06:00
|
|
|
- run:
|
|
|
|
|
name: Install dependencies
|
|
|
|
|
command: |
|
|
|
|
|
python -m venv venv
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
pip install -r requirements.txt
|
|
|
|
|
sudo mkdir -p /media/wrolpi
|
|
|
|
|
- run:
|
|
|
|
|
name: Start Sanic API
|
|
|
|
|
command: |
|
|
|
|
|
. venv/bin/activate
|
|
|
|
|
sanic main:api_app -H 0.0.0.0 -p 8081
|
|
|
|
|
background: true
|
|
|
|
|
- run:
|
|
|
|
|
name: Test Sanic API
|
|
|
|
|
command: |
|
|
|
|
|
sleep 20
|
|
|
|
|
curl http://0.0.0.0:8081/api/echo
|
|
|
|
|
- run:
|
|
|
|
|
name: Stop Sanic API
|
|
|
|
|
command: pkill -f sanic
|
2024-11-02 15:14:02 -06:00
|
|
|
react-app-start:
|
2024-05-08 18:47:32 -06:00
|
|
|
docker:
|
|
|
|
|
- image: cimg/node:20.13
|
|
|
|
|
resource_class: large
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2024-11-02 15:14:02 -06:00
|
|
|
key: app-{{ checksum "app/package-lock.json" }}
|
2024-05-08 18:47:32 -06:00
|
|
|
- run: cd app && npm install --legacy-peer-deps
|
2024-11-02 15:14:02 -06:00
|
|
|
- save_cache:
|
|
|
|
|
key: app-{{ checksum "app/package-lock.json" }}
|
|
|
|
|
paths:
|
|
|
|
|
- ./app/node_modules
|
2024-05-08 18:47:32 -06:00
|
|
|
- run:
|
|
|
|
|
name: Build React App
|
|
|
|
|
command: cd app && DISABLE_ESLINT_PLUGIN=true npm run build
|
2024-11-02 15:14:02 -06:00
|
|
|
- run:
|
|
|
|
|
name: Start React App
|
|
|
|
|
command: cd app && DISABLE_ESLINT_PLUGIN=true npm run start
|
|
|
|
|
background: true
|
|
|
|
|
- run:
|
|
|
|
|
name: Test React App
|
|
|
|
|
command: |
|
|
|
|
|
sleep 20
|
|
|
|
|
curl http://0.0.0.0:3000/manifest.json
|
|
|
|
|
- run:
|
|
|
|
|
name: Stop React App
|
|
|
|
|
command: pkill -f npm
|
|
|
|
|
react-app-cypress-components-chrome:
|
2024-05-08 18:47:32 -06:00
|
|
|
docker:
|
2024-11-02 15:14:02 -06:00
|
|
|
- image: cypress/browsers:node-20.18.0-chrome-130.0.6723.69-1-ff-131.0.3-edge-130.0.2849.52-1
|
2024-05-08 18:47:32 -06:00
|
|
|
resource_class: small
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
2024-11-02 15:14:02 -06:00
|
|
|
key: app-{{ checksum "app/package-lock.json" }}
|
2024-05-08 18:47:32 -06:00
|
|
|
- run: cd app && npm install --legacy-peer-deps
|
|
|
|
|
- run:
|
2024-11-02 15:14:02 -06:00
|
|
|
name: Run Cypress component tests
|
2024-05-08 18:47:32 -06:00
|
|
|
command: |
|
|
|
|
|
cd app
|
2024-11-02 15:14:02 -06:00
|
|
|
npx cypress run --component --browser chrome --reporter junit --reporter-options "mochaFile=test-results.xml"
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/videos
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/screenshots
|
|
|
|
|
- store_test_results:
|
|
|
|
|
path: app/test-results.xml
|
|
|
|
|
react-app-cypress-components-firefox:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cypress/browsers:node-20.18.0-chrome-130.0.6723.69-1-ff-131.0.3-edge-130.0.2849.52-1
|
|
|
|
|
resource_class: small
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
|
|
|
|
key: app-{{ checksum "app/package-lock.json" }}
|
|
|
|
|
- run: cd app && npm install --legacy-peer-deps
|
2024-05-08 18:47:32 -06:00
|
|
|
- run:
|
2024-11-02 15:14:02 -06:00
|
|
|
name: Run Cypress component tests
|
2024-05-08 18:47:32 -06:00
|
|
|
command: |
|
2024-11-02 15:14:02 -06:00
|
|
|
cd app
|
|
|
|
|
npx cypress run --component --browser firefox --reporter junit --reporter-options "mochaFile=test-results.xml"
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/videos
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/screenshots
|
|
|
|
|
- store_test_results:
|
|
|
|
|
path: app/test-results.xml
|
|
|
|
|
react-app-cypress-components-edge:
|
|
|
|
|
docker:
|
|
|
|
|
- image: cypress/browsers:node-20.18.0-chrome-130.0.6723.69-1-ff-131.0.3-edge-130.0.2849.52-1
|
|
|
|
|
resource_class: small
|
|
|
|
|
steps:
|
|
|
|
|
- checkout
|
|
|
|
|
- restore_cache:
|
|
|
|
|
key: app-{{ checksum "app/package-lock.json" }}
|
|
|
|
|
- run: cd app && npm install --legacy-peer-deps
|
2024-05-08 18:47:32 -06:00
|
|
|
- run:
|
2024-11-02 15:14:02 -06:00
|
|
|
name: Run Cypress component tests
|
|
|
|
|
command: |
|
|
|
|
|
cd app
|
|
|
|
|
npx cypress run --component --browser edge --reporter junit --reporter-options "mochaFile=test-results.xml"
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/videos
|
|
|
|
|
- store_artifacts:
|
|
|
|
|
path: app/cypress/screenshots
|
|
|
|
|
- store_test_results:
|
|
|
|
|
path: app/test-results.xml
|
2022-02-20 10:59:30 -07:00
|
|
|
|
|
|
|
|
workflows:
|
2022-03-09 18:40:25 -07:00
|
|
|
wrolpi-api-tests:
|
2022-02-20 10:59:30 -07:00
|
|
|
jobs:
|
2024-05-08 18:47:32 -06:00
|
|
|
- sanic-api-start
|
2023-03-01 13:25:58 -07:00
|
|
|
- api-tests-3-11
|
2024-08-15 21:45:06 -06:00
|
|
|
- api-alembic-migrations
|
2024-05-08 18:47:32 -06:00
|
|
|
# - api-tests-3-12 Sanic does not yet support 3.12.
|
2023-01-07 18:55:07 -07:00
|
|
|
wrolpi-app-test:
|
|
|
|
|
jobs:
|
2024-05-08 18:47:32 -06:00
|
|
|
- react-app-start
|
2024-11-02 15:14:02 -06:00
|
|
|
- react-app-cypress-components-chrome
|
|
|
|
|
- react-app-cypress-components-firefox
|
|
|
|
|
- react-app-cypress-components-edge
|