feat(config): read the HTTP port from .wflcfg #4
This file contains hidden or 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
| name: WFL tests | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: wfl-tests-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| wfl-tests: | |
| name: WFL nightly (Blacksmith) | |
| runs-on: blacksmith-2vcpu-ubuntu-2404 | |
| timeout-minutes: 15 | |
| env: | |
| WFL_IMAGE: bsbyrdwfl/wfl:nightly | |
| TEST_CONTAINER: scriptorium-tests-${{ github.run_id }}-${{ github.run_attempt }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| submodules: recursive | |
| - name: Pull latest WFL nightly and record runtime | |
| id: runtime | |
| shell: bash | |
| run: | | |
| docker pull "$WFL_IMAGE" | |
| image="$(docker image inspect --format '{{index .RepoDigests 0}}' "$WFL_IMAGE")" | |
| echo "image=$image" >> "$GITHUB_OUTPUT" | |
| version="$(docker run --rm --network none "$image" --version)" | |
| { | |
| echo '### WFL nightly test environment' | |
| echo | |
| echo "- Image: $image" | |
| echo "- Runtime: $version" | |
| echo "- Scriptorium: $(git rev-parse HEAD)" | |
| echo "- Scribe: $(git -C lib/scribe rev-parse HEAD)" | |
| echo '- Runner: blacksmith-2vcpu-ubuntu-2404 (Linux x64)' | |
| echo '- Command: python3 scripts/run_tests.py --include-scribe' | |
| echo '- HTTP checks: python3 -m unittest discover -s tests/integration -v' | |
| } | tee -a "$GITHUB_STEP_SUMMARY" | |
| - name: Run WFL suites and HTTP configuration checks | |
| shell: bash | |
| env: | |
| RESOLVED_IMAGE: ${{ steps.runtime.outputs.image }} | |
| run: | | |
| # The published image is a minimal runtime with a WFL entrypoint. | |
| # Install Python only in this disposable container. Scribe fixtures | |
| # go to its temporary directory; the checkout stays read-only. | |
| docker run --rm --init --name "$TEST_CONTAINER" \ | |
| --user 0:0 --entrypoint /bin/sh \ | |
| --mount "type=bind,source=$GITHUB_WORKSPACE,target=/work,readonly" \ | |
| --workdir /work "$RESOLVED_IMAGE" -ec ' | |
| apt-get update | |
| apt-get install --yes --no-install-recommends python3 | |
| python3 --version | |
| wfl --version | |
| python3 scripts/run_tests.py --include-scribe | |
| python3 -m unittest discover -s tests/integration -v | |
| ' | |
| - name: Clean up test container | |
| if: always() | |
| shell: bash | |
| run: | | |
| # Killing a Docker client on cancellation may leave its container up. | |
| if docker container inspect "$TEST_CONTAINER" >/dev/null 2>&1; then | |
| docker container rm --force "$TEST_CONTAINER" | |
| fi |