Merge pull request #5175 from Sage-Bionetworks/release-467 #13
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: 'Build/Run End-to-End Tests' | |
on: push | |
jobs: | |
build-and-run-e2e: | |
if: ${{ github.ref_name == 'develop' || github.ref_name == 'release-**' || github.actor == github.repository_owner }} | |
runs-on: macos-latest | |
env: | |
CONTAINER_NAME: 'swc-tomcat' | |
CI: true | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Setup docker (missing on MacOS) | |
if: runner.os == 'macos' | |
run: | | |
# workaround for https://github.com/actions/runner-images/issues/8104 | |
# ...and handle 8.1.0 regression: https://github.com/Homebrew/homebrew-core/issues/140244 | |
export HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 | |
brew uninstall --ignore-dependencies qemu | |
curl -OSL https://raw.githubusercontent.com/Homebrew/homebrew-core/dc0669eca9479e9eeb495397ba3a7480aaa45c2e/Formula/qemu.rb | |
brew install ./qemu.rb | |
brew install docker | |
colima start | |
- name: Build SWC | |
uses: ./.github/workflows/build | |
- name: Run SWC on Tomcat | |
run: | | |
docker run \ | |
--name "${CONTAINER_NAME}" \ | |
-d --rm \ | |
-p 8888:8080 \ | |
-v "/$(pwd)/target/portal-develop-SNAPSHOT.war:/usr/local/tomcat/webapps/ROOT.war" \ | |
-v "/$(pwd)/e2e_workflow/settings.xml":/root/.m2/settings.xml \ | |
tomcat:9.0 | |
- name: Install Playwright Browsers | |
run: yarn playwright install --with-deps chromium | |
- name: Run Playwright tests | |
env: | |
ADMIN_USERNAME: ${{ secrets.ADMIN_USERNAME }} | |
ADMIN_PASSWORD: ${{ secrets.ADMIN_PASSWORD }} | |
run: yarn playwright test | |
- name: Upload Playwright Report | |
uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: playwright-report | |
path: playwright-report/ | |
retention-days: 30 | |
- name: Stop Tomcat | |
if: always() | |
run: | | |
docker stop "${CONTAINER_NAME}" | |
colima stop |