Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move from BB pipelines to Github actions, add documentation.
- Loading branch information
Showing
9 changed files
with
150 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
name: deploy-to-staging | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
deploy: | ||
name: "Deploy (main to staging)" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Wait for tests to pass | ||
uses: lewagon/wait-on-check-action@v0.2 | ||
with: | ||
ref: ${{ github.ref }} | ||
# check-name: "Test (on Python3.8)" # name of the job we wait for (omit to wait for all checks) | ||
running-workflow-name: "Deploy (main to staging)" # name of the check that will wait for other checks | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 20 # seconds | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: '0' | ||
ref: 'main' | ||
- name: Install SSH key | ||
uses: shimataro/ssh-key-action@v2 | ||
with: | ||
key: ${{ secrets.SSH_DEPLOYMENT_KEY }} # private ssh key | ||
known_hosts: ${{ secrets.KNOWN_DEPLOYMENT_HOSTS }} # make via ssh-keyscan -t rsa <your host> | ||
- run: ci/DEPLOY.sh | ||
env: | ||
BRANCH_NAME: main | ||
STAGING_REMOTE_REPO: ${{ secrets.STAGING_REMOTE_REPO }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: lint-and-test | ||
|
||
on: push | ||
|
||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
name: Check (on Python3.8) | ||
steps: | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: actions/checkout@v2 | ||
- uses: pre-commit/action@v2.0.0 | ||
|
||
test: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
#strategy: # TODO: make work with pre-commit | ||
# matrix: | ||
# python-version: [ '3.8', '3.6' ] | ||
name: "Test (on Python3.8)" | ||
steps: | ||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- uses: actions/checkout@v2 | ||
- run: ci/SETUP.sh | ||
- run: make test | ||
env: | ||
PGHOST: 127.0.0.1 | ||
PGPORT: 5432 | ||
PGUSER: flexmeasures_test | ||
PGDB: flexmeasures_test | ||
PGPASSWORD: flexmeasures_test | ||
|
||
services: | ||
# Label used to access the service container | ||
postgres: | ||
# Docker Hub image | ||
image: postgres:12.5 | ||
env: | ||
POSTGRES_USER: flexmeasures_test | ||
POSTGRES_PASSWORD: flexmeasures_test | ||
POSTGRES_DB: flexmeasures_test | ||
ports: | ||
- 5432:5432 | ||
# needed because the postgres container does not provide a healthcheck | ||
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters