-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcircleci.yml
61 lines (57 loc) · 1.73 KB
/
circleci.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
# This is in `circleci/config.yml` for CircleCI 2.0
version: 2
jobs:
one:
docker:
- image: circleci/ruby:2.4.1
steps:
- checkout
- run: echo "A first hello"
- run: mkdir -p my_workspace
- run: echo "Trying out workspaces" > my_workspace/echo-output
- persist_to_workspace:
# Must be an absolute path, or relative path from working_directory
root: my_workspace
# Must be relative path from root
paths:
- echo-output
two:
docker:
- image: circleci/ruby:2.4.1
steps:
- checkout
- run: echo "A more familiar hi"
- attach_workspace:
# Must be absolute path or relative path from working_directory
at: my_workspace
- run: |
if [[ $(cat my_workspace/echo-output) == "Trying out workspaces" ]]; then
echo "It worked!";
else
echo "Nope!"; exit 1
fi
workflows:
version: 2
one_and_two:
jobs:
- one
- two:
requires:
- one
# ------------------------------------------------------------------------------
# CircleCI & CodeClimate Test Coverage
- run:
name: Setup Code Climate test-reporter
command: |
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
chmod +x ./cc-test-reporter
- run:
name: Run tests
command: |
. venv/bin/activate
./cc-test-reporter before-build
coverage run --omit=*/tests/* --source='./app' manage.py test
coverage xml
python-codacy-coverage -r coverage.xml
./cc-test-reporter after-build --exit-code $?
# ------------------------------------------------------------------------------