|
1 | | -name: run_tests |
| 1 | +# Run locally with act: |
| 2 | +# |
| 3 | +# act pull_request \ |
| 4 | +# --platform fusionauth-builder=[ecr-repo-name]/fusionauth-builder:latest] \ |
| 5 | +# --workflows ./.github/workflows/test.yaml |
2 | 6 |
|
| 7 | +name: Test |
3 | 8 |
|
4 | | -# Controls when the action will run. |
5 | 9 | on: |
6 | 10 | push: |
7 | | - branches: [ "master" ] |
| 11 | + branches: |
| 12 | + - main |
8 | 13 | pull_request: |
9 | | - branches: [ "master" ] |
| 14 | + branches: |
| 15 | + - main |
10 | 16 | workflow_dispatch: |
11 | 17 |
|
12 | | -# A workflow run is made up of one or more jobs that can run sequentially or in parallel |
13 | 18 | jobs: |
14 | | - # This workflow contains a single job called "run_tests" |
15 | 19 | run_tests: |
16 | | - # The type of runner that the job will run on |
17 | | - runs-on: ubuntu-latest |
| 20 | + runs-on: fusionauth-builder |
18 | 21 | env: |
19 | 22 | FUSIONAUTH_URL: http://localhost:9011 |
20 | 23 | FUSIONAUTH_API_KEY: bf69486b-4733-4470-a592-f1bfce7af580 |
21 | | - |
22 | | - # Steps represent a sequence of tasks that will be executed as part of the job |
23 | 24 | steps: |
24 | | - # Setup the system with the repository code, Java, and Ruby |
25 | 25 | - uses: actions/checkout@v4 |
26 | | - - uses: isbang/compose-action@v1.5.1 |
27 | | - with: |
28 | | - compose-file: './src/test/docker/docker-compose.yml' |
29 | | - down-flags: '--volumes' |
30 | | - - uses: actions/setup-python@v5 |
31 | | - with: |
32 | | - python-version: '3.12.2' |
| 26 | + |
| 27 | + - name: Set up FusionAuth |
| 28 | + working-directory: src/test/docker |
| 29 | + run: docker compose up -d |
| 30 | + |
33 | 31 | - name: Install fusionauth library |
| 32 | + shell: bash -l {0} |
34 | 33 | run: pip3 install . |
35 | | - shell: bash |
| 34 | + |
36 | 35 | - name: Check to see if FusionAuth is loaded |
37 | 36 | run: | |
38 | 37 | bash ./src/test/docker/poll-for-kickstart-finish.sh |
39 | | - shell: bash |
40 | | - # Run the tests |
| 38 | +
|
41 | 39 | - name: Run tests |
| 40 | + shell: bash -l {0} |
42 | 41 | run: | |
43 | 42 | python3 src/test/python/fusionauth/rest_client_test.py |
44 | 43 | python3 src/test/python/fusionauth/fusionauth_client_test.py |
45 | | - shell: bash |
0 commit comments