Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 55 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
version: 2.1
orbs:
python: circleci/[email protected]
python: circleci/[email protected]
heroku: circleci/[email protected]
jobs:
build:
build_and_test: # this can be any name you choose
docker:
- image: cimg/python:3.6.10
- image: cimg/python:3.10.1
environment:
DATABASE_URL: postgresql://root@localhost/circle_test?sslmode=disable
- image: circleci/postgres:9.6.2
Expand All @@ -13,13 +14,60 @@ jobs:
POSTGRES_DB: circle_test
steps:
- checkout
- python/install-packages
- python/install-packages:
pkg-manager: pip
- run:
name: Run django tests
command: |
pipenv run python manage.py test
name: Run tests
command: pipenv run python manage.py test # alternatively run `python -m pytest` if you are running vanilla pytest
- store_test_results:
path: test-results
- store_artifacts:
path: test-results
destination: tr1
- persist_to_workspace:
root: ~/project
paths:
- .

deploy: # this can be any name you choose
docker:
- image: cimg/python:3.10.1
steps:
- attach_workspace:
at: ~/project
- heroku/deploy-via-git:
force: true # force push when pushing to the heroku remote, see: https://devcenter.heroku.com/articles/git

workflows:
on_commit:
jobs:
- build_and_test
# Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication
# The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present
# Read more: https://circleci.com/docs/2.0/env-vars/
# - deploy:
# requires:
# - build_and_test # only deploy if the build_and_test job has completed
# filters:
# branches:
# only: master # only deploy when on main/master
nightly:
triggers:
- schedule:
cron: "0 0 * * *"
filters:
branches:
only:
- master
jobs:
- build_and_test
# Follow instructions here to authenticate git for Heroku: https://devcenter.heroku.com/articles/git#http-git-authentication
# The following code may be uncommented, onnce HEROKU_API_KEY & HEROKU_APP_NAME environemnt variables are present
# Read more: https://circleci.com/docs/2.0/env-vars/
# - deploy:
# requires:
# - build_and_test # only deploy if the build_and_test job has completed
# filters:
# branches:
# only: master # only deploy when on main/master
2:06