Playwright tests / schedule #225
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: "Playwright Tests" | |
run-name: Playwright tests / ${{ github.event.pull_request.title || github.event_name }} | |
on: | |
schedule: | |
- cron: "0 1 * * 5" | |
workflow_dispatch: | |
env: | |
IMAGE: ${{ github.repository_owner }}/neon_tests | |
CONTAINER: services-${{ github.run_id }} | |
FAUCET_URL: "${{ secrets.DEVNET_FAUCET_URL }}" | |
SOLANA_URL: "${{ secrets.SOLANA_URL }}" | |
BUILD_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | |
DOCKER_HUB_ORG_NAME: ${{ github.repository_owner }} | |
jobs: | |
dockerize: | |
if: ${{ github.ref_name != 'develop'}} | |
runs-on: ["self-hosted", "k8s-prod"] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: "Dockerize neon tests" | |
id: requirements | |
uses: ./.github/actions/dockerize-neon-tests | |
with: | |
image_tag: ${{ github.sha }} | |
docker_username: ${{ secrets.DOCKER_USERNAME }} | |
docker_password: ${{ secrets.DOCKER_PASSWORD }} | |
image_name: ${{ env.IMAGE }} | |
docker_hub_org_name: ${{ env.DOCKER_HUB_ORG_NAME }} | |
playwright: | |
name: "Playwright UI tests" | |
needs: | |
- dockerize | |
if: | | |
always() && | |
!contains(needs.*.result, 'failure') && | |
!contains(needs.*.result, 'cancelled') | |
runs-on: ["self-hosted", "k8s-prod"] | |
timeout-minutes: 60 | |
env: | |
NETWORK: "devnet" | |
steps: | |
- name: "Checkout repository" | |
uses: actions/checkout@v4 | |
- name: "Define image tag" | |
id: image_tag | |
uses: ./.github/actions/define-image-tag | |
- name: "Pull Docker Test Image" | |
run: docker pull ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }} | |
- name: "Run docker container" | |
run: | | |
docker run -i -d --name=${{ env.CONTAINER }} \ | |
-e CHROME_EXT_PASSWORD=${{ secrets.CHROME_EXT_PASSWORD }} \ | |
--entrypoint /bin/bash ${{ env.IMAGE }}:${{ steps.image_tag.outputs.tag }} | |
- name: "Run Playwright Tests" | |
run: | | |
docker exec -i ${{ env.CONTAINER }} \ | |
/bin/bash -c "export DEVNET_FAUCET_URL=${{ env.FAUCET_URL }} && export SOLANA_URL=${{ env.SOLANA_URL }} && \ | |
xvfb-run python3 ./clickfile.py run ui --network=${{ env.NETWORK }} --ui-item=neonpass" | |
- name: "Generate allure report" | |
if: always() | |
uses: ./.github/actions/generate-allure-report | |
with: | |
container: ${{ env.CONTAINER }} | |
network: ${{ env.NETWORK }} | |
aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
tests_name: ui | |
- name: "Notify on failure" | |
if: failure() && github.ref_name == 'develop' | |
run: | | |
docker exec -i ${{ env.CONTAINER }} \ | |
python3 ./clickfile.py send-notification \ | |
-u ${{ secrets.SLACK_QA_CHANNEL_URL }} \ | |
-b ${{ env.BUILD_URL }} \ | |
-n ${{ env.NETWORK }} \ | |
--test-group ui | |
- name: Remove docker container | |
if: always() | |
run: docker rm -f ${{ env.CONTAINER }} |