Run Smoke Tests #12
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: | | |
echo "TARGET=${BRANCH#deploy-}" >>$GITHUB_ENV | |
- name: Prepare test environment | |
run: | | |
echo "TARGET is ${{ env.TARGET }}" | |
cat - <<EOF > .env.${{ env.TARGET }} | |
DOMAIN=${{ env.TARGET }}.eoepca.org | |
KEYCLOAK=keycloak-v1x.\${DOMAIN} | |
EOAPI=eoapi.\${DOMAIN} | |
EOF | |
- name: Invoke pytest | |
run: | | |
echo "TARGET is ${{ env.TARGET }}" | |
docker run --rm -t \ | |
-e target=${{ env.TARGET }} \ | |
-v ./.env.${{ env.TARGET }}:/work/test/.env.${{ 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 |