Feature/GitHub actions #45
Workflow file for this run
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
name: Lint and test | |
on: [push, pull_request] | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install black | |
run: python -m pip install --upgrade black==22.3.0 | |
- name: make sure that the *same* version is used in Pipfiles to avoid incompatibilities | |
run: grep 'black = "==22.3.0"' rest/Pipfile | |
- name: check the files for correct formatting | |
run: black -l 120 --check . || exit 1 | |
integration-tests: | |
runs-on: ubuntu-latest | |
env: | |
TESTS_SH_CLIENT_ID: ${{ secrets.TESTS_SH_CLIENT_ID }} | |
TESTS_SH_CLIENT_SECRET: ${{ secrets.TESTS_SH_CLIENT_SECRET }} | |
RESULTS_S3_BUCKET_NAME_MAIN: ${{ secrets.RESULTS_S3_BUCKET_NAME_MAIN }} | |
RESULTS_S3_BUCKET_NAME_CREODIAS: ${{ secrets.RESULTS_S3_BUCKET_NAME_CREODIAS }} | |
RESULTS_S3_BUCKET_NAME_USWEST: ${{ secrets.RESULTS_S3_BUCKET_NAME_USWEST }} | |
RESULTS_S3_BUCKET_ACCESS_KEY_ID_MAIN: ${{ secrets.RESULTS_S3_BUCKET_ACCESS_KEY_ID_MAIN }} | |
RESULTS_S3_BUCKET_ACCESS_KEY_ID_CREODIAS: ${{ secrets.RESULTS_S3_BUCKET_ACCESS_KEY_ID_CREODIAS }} | |
RESULTS_S3_BUCKET_ACCESS_KEY_ID_USWEST: ${{ secrets.RESULTS_S3_BUCKET_ACCESS_KEY_ID_USWEST }} | |
RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_MAIN: ${{ secrets.RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_MAIN }} | |
RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_CREODIAS: ${{ secrets.RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_CREODIAS }} | |
RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_USWEST: ${{ secrets.RESULTS_S3_BUCKET_SECRET_ACCESS_KEY_USWEST }} | |
USAGE_REPORTING_BASE_URL_TESTING: ${{ secrets.USAGE_REPORTING_BASE_URL_TESTING }} | |
USAGE_REPORTING_AUTH_URL_TESTING: ${{ secrets.USAGE_REPORTING_AUTH_URL_TESTING }} | |
USAGE_REPORTING_AUTH_CLIENT_ID_TESTING: ${{ secrets.USAGE_REPORTING_AUTH_CLIENT_ID_TESTING }} | |
USAGE_REPORTING_AUTH_CLIENT_SECRET_TESTING: ${{ secrets.USAGE_REPORTING_AUTH_CLIENT_SECRET_TESTING }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Docker-compose build | |
run: docker-compose -f docker-compose.yml -f docker-compose.pytest.yml build | |
- name: Docker-compose up and run pytest | |
run: docker-compose -f docker-compose.yml -f docker-compose.pytest.yml up --exit-code-from pytest | |
- name: Docker-compose cleanup | |
if: always() | |
run: docker-compose -f docker-compose.yml -f docker-compose.pytest.yml down -v |