Skip to content

Add automated functional checks #58

Add automated functional checks

Add automated functional checks #58

Workflow file for this run

name: Docker Image CI
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- env:
IMAGE_EDITION: community
- env:
IMAGE_EDITION: developer
steps:
- uses: actions/checkout@v4
- name: Build and run container image
run: |

Check failure on line 24 in .github/workflows/docker-image.yml

View workflow run for this annotation

GitHub Actions / Docker Image CI

Invalid workflow file

The workflow is not valid. .github/workflows/docker-image.yml (Line: 24, Col: 14): Unrecognized named-value: 'CODE'. Located at position 1 within expression: CODE
docker build --build-arg="IMAGE_EDITION=${{ matrix.env.IMAGE_EDITION }}" -t ci .
docker run -e PROJECT_CODE="${{ CODE }}" -e PROJECT_RULES="${{ RULES }}" -v $(pwd)/tests:/opt/sonarqube/test -d --name ci ci
env:
CODE: "PROJ1"
RULES: "+csharpsquid:S104;-ts:S1561"
- name: Wait for Sonar instance to start
# profile for language 'web' is the last; assume everything is working if we got this far
run: docker logs -f ci |& sed "/Current profile for language 'web' is 'Sonar way'/ q"
timeout-minutes: 3
- name: Install test requirements
run: |
docker exec -u 0:0 ci apt-get update
docker exec -u 0:0 ci apt-get install -y python3 python3-pip
docker exec -u 0:0 ci pip3 install -Ur /opt/sonarqube/test/requirements.txt
- name: Run tests
run: docker exec ci python3 -m unittest -v
- name: Stop the container
run: docker stop ci