mirror of
https://github.com/sartography/protocol-builder-mock.git
synced 2025-02-19 11:06:39 +00:00
Merge branch 'dev' into feature/python-3.9
This commit is contained in:
commit
11f49cfdd2
52
.github/workflows/create-docker-action.yml
vendored
52
.github/workflows/create-docker-action.yml
vendored
@ -2,14 +2,64 @@ name: Create and publish a Docker image
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: ['master']
|
branches: ['main', 'chore/*', 'feature/*', 'bug/*']
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
IMAGE_NAME: ${{ github.repository }}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
sonarcloud:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
with:
|
||||||
|
# Disabling shallow clone is recommended for improving relevancy of reporting
|
||||||
|
fetch-depth: 0
|
||||||
|
- name: SonarCloud Scan
|
||||||
|
uses: sonarsource/sonarcloud-github-action@master
|
||||||
|
with:
|
||||||
|
args: >
|
||||||
|
-Dsonar.organization=sartography
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||||
|
|
||||||
|
run_tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
services:
|
||||||
|
postgres:
|
||||||
|
image: postgres
|
||||||
|
env:
|
||||||
|
POSTGRES_PASSWORD: postgres
|
||||||
|
options: >-
|
||||||
|
--health-cmd pg_isready
|
||||||
|
--health-interval 10s
|
||||||
|
--health-timeout 5s
|
||||||
|
--health-retries 5
|
||||||
|
ports:
|
||||||
|
- 5432:5432
|
||||||
|
steps:
|
||||||
|
- name: Checkout repository
|
||||||
|
uses: actions/checkout@v2
|
||||||
|
- uses: browser-actions/setup-chrome@latest
|
||||||
|
with:
|
||||||
|
chrome-version: stable
|
||||||
|
- uses: actions/setup-python@v3
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
architecture: 'x64'
|
||||||
|
- run: psql -h localhost -c 'create database pb_test;' -U postgres
|
||||||
|
- run: pip install pipenv
|
||||||
|
- run: pipenv install --dev
|
||||||
|
- run: pipenv run coverage run -m pytest
|
||||||
|
- run: pipenv run coverage xml -i
|
||||||
|
|
||||||
build-and-push-image:
|
build-and-push-image:
|
||||||
|
needs:
|
||||||
|
- run_tests
|
||||||
|
- sonarcloud
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
38
.travis.yml
38
.travis.yml
@ -1,38 +0,0 @@
|
|||||||
language: python
|
|
||||||
|
|
||||||
python:
|
|
||||||
- "3.8"
|
|
||||||
|
|
||||||
services:
|
|
||||||
- postgresql
|
|
||||||
- docker
|
|
||||||
|
|
||||||
addons:
|
|
||||||
chrome: stable
|
|
||||||
sonarcloud:
|
|
||||||
organization: "sartography"
|
|
||||||
|
|
||||||
before_install:
|
|
||||||
- psql -c 'create database pb_test;' -U postgres
|
|
||||||
|
|
||||||
install:
|
|
||||||
- pipenv install --dev
|
|
||||||
|
|
||||||
env:
|
|
||||||
global:
|
|
||||||
- TESTING=true
|
|
||||||
- SQLALCHEMY_DATABASE_URI="postgresql://postgres:@localhost:5432/pb_test"
|
|
||||||
|
|
||||||
script:
|
|
||||||
- pipenv run coverage run -m pytest
|
|
||||||
- pipenv run coverage xml -i
|
|
||||||
|
|
||||||
after_success:
|
|
||||||
- sonar-scanner
|
|
||||||
|
|
||||||
notifications:
|
|
||||||
email:
|
|
||||||
on_success: change
|
|
||||||
on_failure: always
|
|
||||||
recipients:
|
|
||||||
- dan@sartography.com
|
|
@ -17,7 +17,7 @@ APPLICATION_ROOT = re.sub(r'//', '/', '/%s/' % environ.get('APPLICATION_ROOT', d
|
|||||||
|
|
||||||
DB_HOST = environ.get('DB_HOST', default="localhost")
|
DB_HOST = environ.get('DB_HOST', default="localhost")
|
||||||
DB_PORT = environ.get('DB_PORT', default="5432")
|
DB_PORT = environ.get('DB_PORT', default="5432")
|
||||||
DB_NAME = environ.get('DB_NAME', default="pb")
|
DB_NAME = environ.get('DB_NAME', default="pb2")
|
||||||
DB_USER = environ.get('DB_USER', default="crc_user")
|
DB_USER = environ.get('DB_USER', default="crc_user")
|
||||||
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
|
DB_PASSWORD = environ.get('DB_PASSWORD', default="crc_pass")
|
||||||
SQLALCHEMY_DATABASE_URI = environ.get(
|
SQLALCHEMY_DATABASE_URI = environ.get(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user