Run Smoke Tests #5
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
# GitHub recommends pinning actions to a commit SHA. | |
# To get a newer version, you will need to update the SHA. | |
# You can also reference a tag or branch, but the action may change without warning. | |
name: Run Smoke Tests | |
on: | |
# via github UI | |
workflow_dispatch: | |
env: | |
BRANCH: ${{ github.ref_name }} | |
jobs: | |
run-tests: | |
name: Run Smoke Tests | |
runs-on: ubuntu-latest | |
steps: | |
- name: Deduce TARGET from branch name | |
run: | | |
TARGET=${BRANCH#deploy-} | |
echo "TARGET is ${TARGET}" | |
- name: Prepare test environment | |
run: | | |
echo "TARGET is ${TARGET}" | |
cat - <<EOF > .env.${TARGET} | |
DOMAIN=${TARGET}.eoepca.org | |
KEYCLOAK=keycloak.\${DOMAIN} | |
EOF | |
- name: Invoke pytest | |
run: | | |
echo "TARGET is ${TARGET}" | |
docker run --rm -t \ | |
-e target=${TARGET} \ | |
-v ./.env.${TARGET}:/work/test/.env.${TARGET} \ | |
-v ./out:/work/out \ | |
eoepca/system-test \ | |
pytest test -m smoketest -v --junit-xml=out/report.xml | |
- name: Publish Test Results | |
uses: EnricoMi/publish-unit-test-result-action@v2 | |
if: always() | |
with: | |
files: | | |
out/**/*.xml |