This repository has been archived by the owner on Jan 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
/
config.yml
91 lines (89 loc) · 2.95 KB
/
config.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
version: 2
jobs:
test-run:
working_directory: ~/sdclientapi
docker:
- image: circleci/python:3.7
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python3.7/site-packages
- restore_cache:
key: deps9-{{ .Branch }}-{{ checksum "dev-requirements.txt" }}
- run:
name: Install dependencies
command: |
virtualenv --python=python3 .venv
source .venv/bin/activate
pip install --require-hashes -r dev-requirements.txt
- save_cache:
key: deps9-{{ .Branch }}-{{ checksum "dev-requirements.txt" }}
paths:
- ".venv"
- "/usr/local/bin"
- "/usr/local/lib/python3.7/site-packages"
- run:
name: Run linter, tests, check for known CVEs
command: |
source .venv/bin/activate
make check
test-against-latest-api:
working_directory: ~/project
machine:
enabled: true
image: ubuntu-1604:201903-01
environment:
DOCKER_API_VERSION: 1.23
steps:
- checkout
- run:
name: Install dependencies
command: |
pyenv global 3.7.0
virtualenv --python=python3 .venv
source .venv/bin/activate
pip install --require-hashes -r dev-requirements.txt
- run:
name: Download SecureDrop server code
command: git clone https://github.com/freedomofpress/securedrop.git
- run:
name: Start spinning up the SecureDrop server container
command: |
cd securedrop
NUM_SOURCES=5 make -C securedrop dev
background: true
- run: # As suggested in https://discuss.circleci.com/t/prevent-race-conditions-by-waiting-for-services-with-dockerize/11215
name: Install dockerize
command: |
wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz &&
sudo tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz &&
rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
environment:
DOCKERIZE_VERSION: v0.6.1
- run:
name: Wait for server to be up and for test sources to load
command: |
dockerize -wait tcp://127.0.0.1:8080 -timeout 30m
sleep 30
- run:
name: Remove VCR cassettes and run tests against latest API
command: |
rm data/*.yml # Removing VCR cassettes
source .venv/bin/activate
make test
workflows:
version: 2
securedrop_ci:
jobs:
- test-run
- test-against-latest-api
nightly:
triggers:
- schedule:
cron: "0 4 * * *"
filters:
branches:
only:
- master
jobs:
- test-against-latest-api