Skip to content

feat[ci]: Add Actions for test PR #8

feat[ci]: Add Actions for test PR

feat[ci]: Add Actions for test PR #8

Workflow file for this run

name: Test PR
on:
pull_request:
types: [synchronize]
jobs:
build:
runs-on: ubuntu-latest
name: build-main-api
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements/test.txt
- name: Static Code Analysis
run: |
pylint **/*.py --fail-under=0.0
- name: Code Coverage
run: |
pytest --ds=demo.settings --cov=. --cov-fail-under=0
- name: Login to Docker Hub
run: echo ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_HUB_USERNAME }} --password-stdin
- name: Build, tag, and push image to Docker Hub
run: |
docker build . --file docker-conf/Dockerfile-django-api --tag ${{ secrets.DOCKER_REGISTRY }}/algova-django-api:${GITHUB_SHA::7}
docker push ${{ secrets.DOCKER_REGISTRY }}/algova-django-api:${GITHUB_SHA::7}
- name: Vulnerability scan
uses: aquasecurity/[email protected]
with:
image-ref: ${{ secrets.DOCKER_REGISTRY }}/algova-django-api:${{ github.sha::7 }}

Check failure on line 39 in .github/workflows/deploy-pr.yml

View workflow run for this annotation

GitHub Actions / Test PR

Invalid workflow file

The workflow is not valid. .github/workflows/deploy-pr.yml (Line: 39, Col: 22): Unexpected symbol: 'sha::7'. Located at position 8 within expression: github.sha::7
format: 'table'
exit-code: '1'