mirror of
https://gitlab.com/timvisee/send.git
synced 2024-11-10 13:13:00 +01:00
54e78b6274
test_upload: This will create a file and make sure it uploads by verifying a file uploads and is assigned a URL. test_download: This will create a file, upload it and then download it making sure it is the same filename that was uploaded. We can expand this later to maybe check the sizes and such. test_progress: This will create a file and make sure the progress bar shows up after it begins uploading. These are python tests and use Pipenv to manage dependencies as well as tox as the virtualenv manager, and finally pytest as the test runner.
141 lines
3.5 KiB
YAML
141 lines
3.5 KiB
YAML
version: 2.0
|
|
jobs:
|
|
build:
|
|
docker:
|
|
- image: circleci/node:8
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: send-{{ checksum "package-lock.json" }}
|
|
- run: npm install
|
|
- save_cache:
|
|
key: send-{{ checksum "package-lock.json" }}
|
|
paths:
|
|
- node_modules
|
|
- run: npm run build
|
|
- persist_to_workspace:
|
|
root: .
|
|
paths:
|
|
- ./*
|
|
test:
|
|
docker:
|
|
- image: circleci/node:8-browsers
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
key: send-{{ checksum "package-lock.json" }}
|
|
- run: npm install
|
|
- save_cache:
|
|
key: send-{{ checksum "package-lock.json" }}
|
|
paths:
|
|
- node_modules
|
|
- run: npm run check
|
|
- run: npm run lint
|
|
- run: npm run test
|
|
- store_artifacts:
|
|
path: coverage
|
|
integration_tests:
|
|
working_directory: ~/send
|
|
machine: true
|
|
steps:
|
|
- checkout
|
|
- restore_cache:
|
|
keys:
|
|
- uitest-cache-{{ checksum "test/integration/Pipfile" }}
|
|
- uitest-cache-{{ checksum "test/integration/pipenv.txt" }}
|
|
- run:
|
|
name: Install Docker Compose
|
|
command: |
|
|
set -x
|
|
pip install docker-compose>=1.18
|
|
docker-compose --version
|
|
- run:
|
|
name: Install Tox
|
|
command: |
|
|
set -x
|
|
pip install tox
|
|
- run:
|
|
name: Start docker container
|
|
command: docker-compose up -d
|
|
- run:
|
|
name: Run User Integration Tests
|
|
command: |
|
|
npm run start:integration-docker
|
|
npm run test-integration-docker
|
|
environment:
|
|
MOZ_HEADLESS: 1
|
|
- store_artifacts:
|
|
path: send-test.html
|
|
- save_cache:
|
|
key: uitest-cache-{{ checksum "test/integration/Pipfile" }}
|
|
paths:
|
|
- test/integration/.tox
|
|
- save_cache:
|
|
key: uitest-cache-{{ checksum "test/integration/pipenv.txt" }}
|
|
paths:
|
|
- test/integration/.tox
|
|
deploy_dev:
|
|
machine: true
|
|
steps:
|
|
- attach_workspace:
|
|
at: .
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
- run: docker build -t mozilla/send:latest .
|
|
- run: docker push mozilla/send:latest
|
|
deploy_stage:
|
|
machine: true
|
|
steps:
|
|
- attach_workspace:
|
|
at: .
|
|
- run: docker login -u $DOCKER_USER -p $DOCKER_PASS
|
|
- run: docker build -t mozilla/send:$CIRCLE_TAG .
|
|
- run: docker push mozilla/send:$CIRCLE_TAG
|
|
workflows:
|
|
version: 2
|
|
test_pr:
|
|
jobs:
|
|
- test:
|
|
filters:
|
|
branches:
|
|
ignore: master
|
|
- integration_tests
|
|
build_and_deploy_dev:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
branches:
|
|
only: master
|
|
tags:
|
|
ignore: /^v.*/
|
|
- deploy_dev:
|
|
requires:
|
|
- build
|
|
filters:
|
|
branches:
|
|
only: master
|
|
tags:
|
|
ignore: /^v.*/
|
|
build_and_deploy_stage:
|
|
jobs:
|
|
- build:
|
|
filters:
|
|
branches:
|
|
ignore: /.*/
|
|
tags:
|
|
only: /^v.*/
|
|
- test:
|
|
filters:
|
|
branches:
|
|
ignore: /.*/
|
|
tags:
|
|
only: /^v.*/
|
|
- deploy_stage:
|
|
requires:
|
|
- build
|
|
- test
|
|
filters:
|
|
branches:
|
|
ignore: /.*/
|
|
tags:
|
|
only: /^v.*/
|