Skip to content

Commit

Permalink
Compile and fuzz in a single step
Browse files Browse the repository at this point in the history
  • Loading branch information
iainsproat committed Jan 3, 2025
1 parent d169bc3 commit c9eb9cf
Showing 1 changed file with 32 additions and 34 deletions.
66 changes: 32 additions & 34 deletions .github/workflows/graphql-api-fuzzer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,30 @@ jobs:
timeout-minutes: 1
run: |
docker compose --file ${{ github.workspace }}/speckle-server/setup/fuzzer/docker-compose-speckle.yml up --detach
until curl --output /dev/null --silent --head --fail http://127.0.0.1:3000/readiness; do
echo "Waiting a further 3 seconds for speckle-server to start..."
sleep 3
done
- name: Restore cached Graphqler configuration
id: cache-config-restore
uses: actions/cache/restore@v4
with:
path: |
${{ github.workspace }}/graphqlerConfig
key: graphqler-config-${{ github.sha }}

- name: Generate Graphqler config from Graphql server
if: steps.cache-config-restore.outputs.cache-hit != 'true'
working-directory: ${{ github.workspace }}/graphqler-fuzzer
run: |
poetry run python ./graphqler --mode compile --url http://127.0.0.1:3000/graphql --path ${{ github.workspace }}/graphqlerOutput
- name: Print the Graphqler configuration
run: |
ls -la ${{ github.workspace }} || true
ls -la ${{ github.workspace }}/graphqlerOutput || true
ls -la ${{ github.workspace }}/graphqlerOutput/compiled || true
# - name: Restore cached Graphqler configuration
# id: cache-config-restore
# uses: actions/cache/restore@v4
# with:
# path: |
# ${{ github.workspace }}/graphqlerConfig
# key: graphqler-config-${{ github.sha }}

# - name: Generate Graphqler config from Graphql server
# if: steps.cache-config-restore.outputs.cache-hit != 'true'
# working-directory: ${{ github.workspace }}/graphqler-fuzzer
# run: |
# poetry run python ./graphqler --mode compile --url http://127.0.0.1:3000/graphql --path ${{ github.workspace }}/graphqlerOutput

# - name: Print the Graphqler configuration
# run: |
# ls -la ${{ github.workspace }} || true
# ls -la ${{ github.workspace }}/graphqlerOutput || true
# ls -la ${{ github.workspace }}/graphqlerOutput/compiled || true
# echo ""
# echo "############################################"
# echo "# Engine settings #"
Expand All @@ -93,25 +97,19 @@ jobs:
# echo "############################################"
# echo ""
# cat ${{ github.workspace }}/graphqlerOutput/compiled/engine_settings.json

- name: Save Graphqler Config
if: steps.cache-config-restore.outputs.cache-hit != 'true'
id: cache-config-save
uses: actions/cache/save@v4
with:
path: |
${{ github.workspace }}/graphqlerOutput
key: ${{ steps.cache-config-restore.outputs.cache-primary-key }}
# - name: Save Graphqler Config
# if: steps.cache-config-restore.outputs.cache-hit != 'true'
# id: cache-config-save
# uses: actions/cache/save@v4
# with:
# path: |
# ${{ github.workspace }}/graphqlerOutput
# key: ${{ steps.cache-config-restore.outputs.cache-primary-key }}

- name: Run Graphqler fuzz test
working-directory: ${{ github.workspace }}/graphqler-fuzzer
run: |
until curl --output /dev/null --silent --head --fail http://127.0.0.1:3000/readiness; do
echo "Waiting a further 3 seconds for speckle-server to start..."
sleep 3
done
poetry run python ./graphqler --mode fuzz --url http://127.0.0.1:3000/graphql --path ${{ github.workspace }}/graphqlerOutput --auth 'Bearer 103b2cf86168ec87fc6ec88978455667feb0f08d12' --config ${{ github.workspace }}/speckle-server/setup/fuzzer/config.graphqler.toml
poetry run python ./graphqler --mode run --url http://127.0.0.1:3000/graphql --path ${{ github.workspace }}/graphqlerOutput --auth 'Bearer 103b2cf86168ec87fc6ec88978455667feb0f08d12' --config ${{ github.workspace }}/speckle-server/setup/fuzzer/config.graphqler.toml
- name: Print the results
if: always()
Expand Down

0 comments on commit c9eb9cf

Please sign in to comment.