Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
frederikprijck committed Nov 9, 2023
1 parent 1a3b3a5 commit f1d19a8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/actions/test/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,15 @@ inputs:
working-directory:
description: The current working directory
required: true
domain:
description: The Auth0 domain to use
required: true
client-id:
description: The Auth0 client id to use
required: true
api-identifier:
description: The Auth0 API identifier to use
required: true

runs:
using: composite
Expand All @@ -15,9 +24,9 @@ runs:
env:
AUTH0_CFG: ${{ inputs.working-directory }}/auth_config.json
AUTH0_EXAMPLE_CFG: ${{ inputs.working-directory }}/auth_config.json.example
AUTH0_TEST_DOMAIN: ${{ secrets.AUTH0_TEST_DOMAIN }}
AUTH0_TEST_CLIENT_ID: ${{ secrets.AUTH0_TEST_CLIENT_ID }}
AUTH0_TEST_API_IDENTIFIER: ${{ secrets.AUTH0_TEST_API_IDENTIFIER }}
AUTH0_TEST_DOMAIN: ${{ inputs.domain }}
AUTH0_TEST_CLIENT_ID: ${{ inputs.client-id }}
AUTH0_TEST_API_IDENTIFIER: ${{ inputs.api-identifier }}
run: |
sed \
-e "s/{DOMAIN}/$AUTH0_TEST_DOMAIN/g" \
Expand All @@ -33,14 +42,17 @@ runs:
SAMPLE_PATH: ${{ inputs.working-directory }}
IMAGE_NAME: ${{ github.event.pull_request.head.sha || github.sha }}
CONTAINER_NAME: ${{ github.event.pull_request.head.sha || github.sha }}
shell: bash
run: |
docker build -t $IMAGE_NAME ./$SAMPLE_PATH
docker run -d -p 4200:4200 --name $CONTAINER_NAME $IMAGE_NAME
- name: Wait for app to be available
shell: bash
run: |
sleep 10
docker run --network host --rm appropriate/curl --retry 8 --retry-connrefused -v localhost:4200
- name: Run tests
shell: bash
run: |
docker create --env "SAMPLE_PORT=4200" --network host --name tester codeceptjs/codeceptjs codeceptjs run-multiple --all --steps
docker cp $(pwd)/lock_login_test.js tester:/tests/lock_login_test.js
Expand All @@ -50,6 +62,7 @@ runs:
- name: Copy app container logs
env:
CONTAINER_NAME: ${{ github.event.pull_request.head.sha || github.sha }}
shell: bash
run: |
mkdir -p /tmp/out
docker logs $CONTAINER_NAME > /tmp/out/app_logs.log
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,9 @@ jobs:
uses: ./.github/actions/test
with:
working-directory: Sample-01
domain: ${{ secrets.AUTH0_TEST_DOMAIN }}
client-id: ${{ secrets.AUTH0_TEST_CLIENT_ID }}
api-identifier: ${{ secrets.AUTH0_TEST_API_IDENTIFIER }}

e2e-standalone:
name: E2E Test Standalone
Expand All @@ -88,4 +91,7 @@ jobs:
uses: ./.github/actions/test
with:
working-directory: Standalone
domain: ${{ secrets.AUTH0_TEST_DOMAIN }}
client-id: ${{ secrets.AUTH0_TEST_CLIENT_ID }}
api-identifier: ${{ secrets.AUTH0_TEST_API_IDENTIFIER }}

0 comments on commit f1d19a8

Please sign in to comment.