Skip to content
Merged
Show file tree
Hide file tree
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
44 changes: 34 additions & 10 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,34 @@ version: 2.1

jobs:
build:
docker:
- image: circleci/python:2.7.18
steps:
- checkout
- run:
command: |
pip install --user sqlalchemy
pip install --user python-dateutil
python setup.py install --user
- persist_to_workspace:
root: ~/.local
paths:
- lib # Save installed Python libraries (including dbp itself)
unittest:
docker:
- image: circleci/python:2.7.18
steps:
- checkout
- attach_workspace:
at: ~/.local
- run:
command: |
python unit_tests/test_all.py -v
createpostgres:
docker:
- image: circleci/python:2.7.18
environment:
PIPENV_VENV_IN_PROJECT: true
DATABASE_URL: postgresql://root@localhost/circle_test?sslmode=disable

- image: circleci/postgres:9.6.2-alpine
environment:
POSTGRES_USER: root
Expand All @@ -21,20 +43,22 @@ jobs:
PGHOST: localhost
steps:
- checkout
- run: sudo chown -R circleci:circleci /usr/local/bin
- run: sudo chown -R circleci:circleci /usr/local/lib/python2.7/site-packages
- run: sudo apt-get install vim
- run:
- attach_workspace:
at: ~/.local
- run:
command: |
sudo apt install -y postgresql-client
createdb -h localhost sndd -O root
pip install sqlalchemy
pip install python-dateutil
pip install psycopg2
python setup.py install
pip install --user psycopg2
python scripts/CreateDBsabrs.py

workflows:
main:
jobs:
- build
- unittest:
requires:
- build
- createpostgres:
requires:
- build
47 changes: 45 additions & 2 deletions docs/developer/github.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Github integration
******************

There are several files in the repository that serve to manage the interaction
between github and the repository, and other settings in github that are
between GitHub and the repository, and other settings in GitHub that are
relevant. Generally administrators manage thes settings, but anybody can
submit a pull request that changes the files managing this interaction.

Expand All @@ -18,7 +18,8 @@ Several documentation files are also rendered by Github. See
Issue and Pull Request Templates
================================
These files are in the ``.github`` directory of the repository, and documented
`here <https://docs.github.com/en/github/building-a-strong-community/about-issue-and-pull-request-templates>`_
`at GitHub <https://docs.github.com/en/github/building-a-strong-community/
about-issue-and-pull-request-templates>`_.

Settings
========
Expand All @@ -32,3 +33,45 @@ This is stored on a separate branch; `this page <https://docs.github.com/
en/github/working-with-github-pages/
configuring-a-publishing-source-for-your-github-pages-site>`_ describes
how it is rendered.

CircleCI
========
Continuous integration is managed through `CircleCI <https://circleci.com/>`_.

Some project settings:

"Only build pull requests" is on; we will not build all branches.

CircleCI refers to a PR that is relative to a fork as a "forked PR". Because
this the preferred means of submitting a PR, "Build forked pull requests"
is on. (The PR itself must actually be submitted to the dbprocessing
repository).

We require status checks to pass before merging to master; in the GitHub
branch settings, this takes the form of a branch protection rule that requires
the circleci jobs to succeed on the PR. `This document
<https://support.circleci.com/hc/en-us/articles/
360004346254-Workflow-status-checks-never-completes-because-
of-ci-circleci-Waiting-for-status-to-be-reported>`_ is somewhat ambiguous,
but what it appears to mean is that the top-level circleci check should not
be selected (individual jobs should.). All jobs are selected.

The GitHub checks are set up as described `in the CircleCI docs
<https://circleci.com/docs/2.0/enable-checks/>`_. This involves
enabling GitHub checks on the dbprocessing repository (which
ultimately redirects to a GitHub setting) and then enabling "GitHub
Status Updates" in the CircleCI advanced project settings.

The "webhooks" repository setting on GitHub controls the triggering of
CircleCI; this is set to "Let me select individual events" and we have
just "Pull requests", "Pushes" and "Releases" selected. (This was the
default setup; normally only PRs matter, as we don't do pushes without
PR, and we don't do CircleCI processing of releases.) This is also
where a hook can be re-delivered to CircleCI (triggering processing
again) if the build never happened on CircleCI (the build can also be
restarted on CircleCI if it has already run.)

For ssh access to the CircleCI build environment, click "Project
Settings" in the dbprocessing project on CircleCI, then "SSH Keys" and
add a key there. (This needs to be the private key, so use one just
for this purpose.)
1 change: 0 additions & 1 deletion scripts/DBRunner.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import subprocess

import dateutil.parser as dup
import spacepy.toolbox as tb

from dbprocessing import dbprocessing
from dbprocessing.runMe import ProcessException
Expand Down