feat: support passing custom api url during build #71
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: Test e2e for PR | |
on: | |
pull_request: | |
jobs: | |
check-changed-files: | |
runs-on: ubuntu-20.04 | |
name: Check changed files | |
outputs: | |
CANT_PASS_WITHOUT_TESTS: ${{ steps.decision.outputs.CANT_PASS_WITHOUT_TESTS }} | |
steps: | |
- id: files | |
uses: jitterbit/get-changed-files@b17fbb00bdc0c0f63fcf166580804b4d2cdc2a42 | |
- name: Make decision based on changed files | |
id: decision | |
run: | | |
cantPassWithoutTests=false | |
for changed_file in ${{ steps.files.outputs.all }}; do | |
if [[ ${changed_file} =~ ^(assets|generators)\/.+$ ]]; then | |
cantPassWithoutTests=true | |
fi | |
if [[ ${changed_file} =~ ^build\.ts$ ]]; then | |
cantPassWithoutTests=true | |
fi | |
done | |
echo $cantPassWithoutTests | |
echo CANT_PASS_WITHOUT_TESTS=${cantPassWithoutTests} >> $GITHUB_OUTPUT | |
build-and-test-e2e: | |
runs-on: ubuntu-20.04 | |
name: Test e2e for PR | |
needs: check-changed-files | |
if: needs['check-changed-files'].outputs.CANT_PASS_WITHOUT_TESTS == 'true' | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install node | |
uses: actions/setup-node@v3 | |
with: | |
node-version-file: '.node-version' | |
- name: Install dependencies | |
run: yarn install | |
- name: Install Playwright | |
run: npx playwright install | |
- name: Extract Branch Name | |
id: extract-branch | |
run: | | |
echo SUBDOMAIN=$(echo ${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}} | perl -pe 's/[^a-zA-Z0-9]+/-/g and s/-+$//g' | tr '[:upper:]' '[:lower:]') >> $GITHUB_OUTPUT | |
- name: Run test | |
run: yarn test:e2e | |
env: | |
TEST_DOMAIN: 'https://${{steps.extract-branch.outputs.SUBDOMAIN}}.${{secrets.FPJS_CI_DOMAIN}}' | |
TEST_RESULT_DOMAIN: ${{secrets.TEST_RESULT_DOMAIN}} | |
TEST_RESULT_PATH: ${{secrets.TEST_RESULT_PATH}} | |
INTEGRATION_PATH: ${{secrets.INTEGRATION_PATH}} | |
RESULT_PATH: ${{secrets.RESULT_PATH}} | |
AGENT_PATH: ${{secrets.AGENT_PATH}} | |
FPJS_API_KEY: ${{secrets.FPJS_API_KEY}} |