Skip to content

Commit

Permalink
Merge pull request #27 from FusionAuth/jj/test-workflow
Browse files Browse the repository at this point in the history
fix branch names, clean up test workflow
  • Loading branch information
johnjeffers authored Jun 10, 2024
2 parents 70992f6 + 15ffc99 commit 77e0e9b
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 46 deletions.
23 changes: 1 addition & 22 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,17 @@
#
# act pull_request [--input command=[command]] \
# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \
# --workflows ./.github/workflows/release.yaml \
# --workflows ./.github/workflows/deploy.yaml \
# --env-file <(aws configure export-credentials --profile [aws-profile] --format env)

name: Deploy

on:
push:
branches:
- main
pull_request:
branches:
- main
workflow_dispatch:
inputs:
command:
type: choice
options:
- build # build only
- publish # build & publish to pypi
- release # build & release to svn
default: build
Expand All @@ -28,20 +21,6 @@ permissions:
contents: read

jobs:
build:
if: |
github.event_name == 'pull_request' ||
github.event_name == 'push' ||
github.event_name == 'workflow_dispatch' && inputs.command == 'build'
runs-on: fusionauth-builder
steps:
- name: checkout
uses: actions/checkout@v4

- name: compile
shell: bash -l {0}
run: sb compile

deploy:
if: |
github.event_name == 'workflow_dispatch' &&
Expand Down
42 changes: 20 additions & 22 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,43 @@
name: run_tests
# Run locally with act:
#
# act pull_request \
# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \
# --workflows ./.github/workflows/test.yaml

name: Test

# Controls when the action will run.
on:
push:
branches: [ "master" ]
branches:
- main
pull_request:
branches: [ "master" ]
branches:
- main
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "run_tests"
run_tests:
# The type of runner that the job will run on
runs-on: ubuntu-latest
runs-on: fusionauth-builder
env:
FUSIONAUTH_URL: http://localhost:9011
FUSIONAUTH_API_KEY: bf69486b-4733-4470-a592-f1bfce7af580

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Setup the system with the repository code, Java, and Ruby
- uses: actions/checkout@v4
- uses: isbang/[email protected]
with:
compose-file: './src/test/docker/docker-compose.yml'
down-flags: '--volumes'
- uses: actions/setup-python@v5
with:
python-version: '3.12.2'

- name: Set up FusionAuth
working-directory: src/test/docker
run: docker compose up -d

- name: Install fusionauth library
shell: bash -l {0}
run: pip3 install .
shell: bash

- name: Check to see if FusionAuth is loaded
run: |
bash ./src/test/docker/poll-for-kickstart-finish.sh
shell: bash
# Run the tests
- name: Run tests
shell: bash -l {0}
run: |
python3 src/test/python/fusionauth/rest_client_test.py
python3 src/test/python/fusionauth/fusionauth_client_test.py
shell: bash
2 changes: 0 additions & 2 deletions src/test/docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
version: '3'

services:
db:
image: postgres:16.0-alpine
Expand Down

0 comments on commit 77e0e9b

Please sign in to comment.