Add automated functional checks #58
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: 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 GitHub Actions / Docker Image CIInvalid workflow file
|
||
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 |