refactor: upgrade FOCA & major app rewrite #21
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: cwl-WES checks | |
on: | |
push: | |
branches: [dev] | |
pull_request: | |
branches: [dev] | |
jobs: | |
lint: | |
name: Run linting | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: "3.7" | |
- name: Install requirements | |
run: | | |
pip install . | |
pip install -r requirements_dev.txt | |
- name: Lint with Flake8 | |
run: flake8 cwl_wes/ setup.py | |
- name: Lint with Pylint | |
run: pylint cwl_wes/ setup.py | |
test: | |
name: Run tests | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Deploy app | |
run: docker-compose up -d --build | |
- name: Wait for app startup | |
shell: bash | |
run: sleep 20 | |
- name: Run integration tests | |
shell: bash | |
run: bash tests/integration_tests.sh | |
- name: Tear down app | |
run: docker-compose down | |
publish: | |
name: Build and publish app image | |
runs-on: ubuntu-latest | |
if: ${{ github.event_name == 'push' }} | |
needs: [lint, test] | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Generate tag | |
run: | | |
echo "TAG=$(date '+%Y%m%d')" >> $GITHUB_ENV | |
- name: Build and publish image | |
id: docker | |
uses: philips-software/docker-ci-scripts@v5.0.0 | |
with: | |
dockerfile: . | |
image-name: "cwl-wes" | |
tags: "latest ${{ env.TAG }}" | |
push-branches: "${{ github.event.repository.default_branch }}" | |
env: | |
REGISTRY_USERNAME: ${{ secrets.DOCKERHUB_LOGIN }} | |
REGISTRY_TOKEN: "${{ secrets.DOCKERHUB_TOKEN }}" | |
DOCKER_ORGANIZATION: ${{ secrets.DOCKERHUB_ORG }} | |
GITHUB_ORGANIZATION: ${{ github.repository_owner }} | |
- name: Verify that image was pushed | |
run: | | |
echo "Push indicator: ${{ steps.docker.outputs.push-indicator }}" | |
echo "# Set to 'true' if image was pushed, empty string otherwise" | |
test "${{ steps.docker.outputs.push-indicator }}" == "true" |