From a4ef35b2875db114f0983bf2d23e483f0cd16cb2 Mon Sep 17 00:00:00 2001 From: Tatenda <31291528+rideam@users.noreply.github.com> Date: Wed, 20 Mar 2024 13:52:59 +0200 Subject: [PATCH 1/3] update to use fusionauth-github-action from marketplace --- .github/workflows/test.yaml | 62 +++++++++++++++++++++++++++++++------ README.md | 8 +++-- 2 files changed, 58 insertions(+), 12 deletions(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 4b9a98d..8367490 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -3,30 +3,26 @@ on: push: branches: - main_RENAME_THIS_TO_ENABLE_TEST + workflow_dispatch: jobs: run-tests: runs-on: ubuntu-latest - services: - docker: - image: docker:19.03.12 - options: --privileged # container has full access to host - ports: - - 9011:9011 - steps: - name: Checkout repository uses: actions/checkout@v4 + - name: Start FusionAuth + uses: fusionauth/fusionauth-github-action@v1 + with: + FUSIONAUTH_VERSION: "latest" # Optional: provide FusionAuth version number otherwise it defaults to latest + - name: Set up Node.js uses: actions/setup-node@v4 with: node-version: '18' - - name: Start FusionAuth in Docker - run: docker-compose up -d # -d in background - - name: Install npm dependencies run: | npm install @@ -41,3 +37,49 @@ jobs: - name: Run Playwright tests run: npx playwright test --project=chromium working-directory: ./app + + +# Optional: If you want to start FusionAuth with docker-compose instead of the action you can use the configuration below +# name: Test FusionAuth login +# on: +# push: +# branches: +# - main_RENAME_THIS_TO_ENABLE_TEST + +# jobs: +# run-tests: +# runs-on: ubuntu-latest + +# services: +# docker: +# image: docker:19.03.12 +# options: --privileged # container has full access to host +# ports: +# - 9011:9011 + +# steps: +# - name: Checkout repository +# uses: actions/checkout@v4 + +# - name: Set up Node.js +# uses: actions/setup-node@v4 +# with: +# node-version: '18' + +# - name: Start FusionAuth in Docker +# run: docker-compose up -d # -d in background + +# - name: Install npm dependencies +# run: | +# npm install +# npx playwright install-deps +# npx playwright install +# working-directory: ./app + +# - name: Start app +# run: npm run start & # & in background +# working-directory: ./app + +# - name: Run Playwright tests +# run: npx playwright test --project=chromium +# working-directory: ./app diff --git a/README.md b/README.md index 7a4fe54..24b9b5b 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ It's part of the article available at: https://fusionauth.io/docs/get-started/ru To run this application you will need Node.js and Docker installed. In a terminal run the code below. ```bash -git clone https://github.com/FusionAuth/fusionauth_github_actions.git +git clone https://github.com/FusionAuth/fusionauth-example-github-actions.git docker compose up ``` @@ -35,4 +35,8 @@ npx playwright test --project=chromium; ## Run the tests in a GitHub action -To run these tests in a GitHub action, fork this repository, change the branch in `.github/workflows/test.yaml` from `main_RENAME_THIS_TO_ENABLE_TEST` to `main`. Commit and push. The action will start running in the Actions tab in the repository site. +> By default, GitHub prevents action workflows from running on forked repositories. To grant permission for the workflow to execute, navigate to the Actions tab on your forked repository in GitHub and click on the **I understand my workflows, go ahead and enable them** button on the repository. + +To run these tests in a GitHub action, fork this repository, change the branch name in `.github/workflows/test.yaml` from `main_RENAME_THIS_TO_ENABLE_TEST` to `main`. Commit and push. The action will start running in the Actions tab in the repository site. + + From 30074099a9b1470274824b62f9cb912f3d2aa4a4 Mon Sep 17 00:00:00 2001 From: Tatenda <31291528+rideam@users.noreply.github.com> Date: Wed, 20 Mar 2024 14:04:04 +0200 Subject: [PATCH 2/3] make the docker-compose option clearer --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 8367490..03b2cee 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./app -# Optional: If you want to start FusionAuth with docker-compose instead of the action you can use the configuration below +# Optional: Though using the fusionauth-github-action is the preffered method to start FusionAuth in the workflow, if you want to start FusionAuth with docker-compose instead of the fusionauth-github-action you can use the configuration below (for example if you need customizations such as to use a custom password hashing plugin). # name: Test FusionAuth login # on: # push: From 5cded91464113911c98d3b40bce77da22c26eccc Mon Sep 17 00:00:00 2001 From: worktheclock <85885287+worktheclock@users.noreply.github.com> Date: Fri, 22 Mar 2024 12:49:41 +0200 Subject: [PATCH 3/3] Test language edit --- .github/workflows/test.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 03b2cee..fd58dd0 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -39,7 +39,7 @@ jobs: working-directory: ./app -# Optional: Though using the fusionauth-github-action is the preffered method to start FusionAuth in the workflow, if you want to start FusionAuth with docker-compose instead of the fusionauth-github-action you can use the configuration below (for example if you need customizations such as to use a custom password hashing plugin). +# Optional: Using the fusionauth-github-action is the preferred method to start FusionAuth in the workflow, but if you want to start FusionAuth with docker-compose instead, you can use the configuration below (for example, if you need to use a custom password hashing plugin). # name: Test FusionAuth login # on: # push: