-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from FusionAuth/feature/improve-readme-add-wor…
…kflow Improving README and adding workflow to test the library
- Loading branch information
Showing
8 changed files
with
350 additions
and
42 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "docker" | ||
directory: "/.github/fusionauth" | ||
schedule: | ||
interval: "weekly" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DATABASE_USERNAME=fusionauth | ||
DATABASE_PASSWORD=hkaLBM3RVnyYeYeqE3WI1w2e4Avpy0Wd5O3s3 | ||
FUSIONAUTH_APP_MEMORY=256M | ||
FUSIONAUTH_APP_RUNTIME_MODE=development | ||
POSTGRES_USER=postgres | ||
POSTGRES_PASSWORD=postgres |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
image: postgres:16.0-alpine | ||
environment: | ||
PGDATA: /var/lib/postgresql/data/pgdata | ||
POSTGRES_USER: ${POSTGRES_USER} | ||
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} | ||
healthcheck: | ||
test: [ "CMD-SHELL", "pg_isready -U postgres" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 | ||
networks: | ||
- db_net | ||
restart: unless-stopped | ||
volumes: | ||
- db_data:/var/lib/postgresql/data | ||
|
||
fusionauth: | ||
image: fusionauth/fusionauth-app:latest | ||
depends_on: | ||
db: | ||
condition: service_healthy | ||
environment: | ||
DATABASE_URL: jdbc:postgresql://db:5432/fusionauth | ||
DATABASE_ROOT_USERNAME: ${POSTGRES_USER} | ||
DATABASE_ROOT_PASSWORD: ${POSTGRES_PASSWORD} | ||
DATABASE_USERNAME: ${DATABASE_USERNAME} | ||
DATABASE_PASSWORD: ${DATABASE_PASSWORD} | ||
FUSIONAUTH_APP_MEMORY: ${FUSIONAUTH_APP_MEMORY} | ||
FUSIONAUTH_APP_RUNTIME_MODE: ${FUSIONAUTH_APP_RUNTIME_MODE} | ||
FUSIONAUTH_APP_SILENT_MODE: true | ||
FUSIONAUTH_APP_URL: http://fusionauth:9011 | ||
FUSIONAUTH_APP_KICKSTART_FILE: /usr/local/fusionauth/kickstart.json | ||
SEARCH_TYPE: database | ||
networks: | ||
- db_net | ||
restart: unless-stopped | ||
ports: | ||
- 9011:9011 | ||
volumes: | ||
- fusionauth_config:/usr/local/fusionauth/config | ||
- ./kickstart.json:/usr/local/fusionauth/kickstart.json | ||
|
||
networks: | ||
db_net: | ||
driver: bridge | ||
|
||
volumes: | ||
db_data: | ||
fusionauth_config: |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
{ | ||
"variables": { | ||
"applicationid": "e9fdb985-9173-4e01-9d73-ac2d60d1dc8e", | ||
"apiKey": "72a8c464b86c3c9098c33da73f471b8a0352f6e14087ddc3", | ||
"asymmetricKeyId": "#{UUID()}", | ||
"defaultTenantId": "d7d09513-a3f5-401c-9685-34ab6c552453", | ||
"adminEmail": "[email protected]", | ||
"adminPassword": "password" | ||
}, | ||
"apiKeys": [ | ||
{ | ||
"key": "#{apiKey}", | ||
"description": "Unrestricted API key" | ||
} | ||
], | ||
"requests": [ | ||
{ | ||
"method": "POST", | ||
"url": "/api/key/generate/#{asymmetricKeyId}", | ||
"tenantId": "#{defaultTenantId}", | ||
"body": { | ||
"key": { | ||
"algorithm": "RS256", | ||
"name": "For GitHub Actions", | ||
"length": 2048 | ||
} | ||
} | ||
}, | ||
{ | ||
"method": "POST", | ||
"url": "/api/user/registration", | ||
"body": { | ||
"user": { | ||
"email": "#{adminEmail}", | ||
"password": "#{adminPassword}" | ||
}, | ||
"registration": { | ||
"applicationId": "#{FUSIONAUTH_APPLICATION_ID}", | ||
"roles": [ | ||
"admin" | ||
] | ||
} | ||
} | ||
} | ||
] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: Test Library | ||
|
||
on: | ||
push: | ||
branches: [ "master" ] | ||
pull_request: | ||
branches: [ "master" ] | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up FusionAuth | ||
working-directory: .github/fusionauth | ||
run: docker compose up -d | ||
|
||
- name: Validate composer.json and composer.lock | ||
run: composer validate | ||
|
||
- name: Cache Composer packages | ||
id: composer-cache | ||
uses: actions/cache@v3 | ||
with: | ||
path: vendor | ||
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-php- | ||
- name: Install dependencies | ||
run: composer install --prefer-dist --no-progress | ||
|
||
- name: Waiting for FusionAuth App | ||
run: timeout 30 bash -c 'while [[ "$(curl -s -o /dev/null -w ''%{http_code}'' localhost:9011)" != "200" ]]; do sleep 5; done' || false | ||
|
||
- name: Run test suite | ||
run: composer run test |
Oops, something went wrong.