Skip to content

Commit

Permalink
ci: Add missing environment variable to integration-test (#641)
Browse files Browse the repository at this point in the history
### Motivation

When we migrated the CI to Github Actions we lost an important
configuration for the integration test that makes sure we're using the
copy of this repo from the PR, rather than cloning from upstream. This
can be seen in the logs of recent PR jobs:

```
** Cloning https://github.com/apple/swift-openapi-generator to /tmp/run-integration-test.sh.SUVBe45RMQ/swift-openapi-generator
Cloning into '/tmp/run-integration-test.sh.SUVBe45RMQ/swift-openapi-generator'...
** Extracting name for Swift package: /__w/swift-openapi-generator/swift-openapi-generator
** Overriding dependency in /tmp/run-integration-test.sh.SUVBe45RMQ/swift-openapi-generator/IntegrationTest on swift-openapi-generator to use /__w/swift-openapi-generator/swift-openapi-generator
```

This used to be specified in the Docker Compose file as an environment
variable but dropped off during migration.

### Modifications

Add the environment variable back to use `file://${GITHUB_WORKSPACE}`
for the clone.

Note that one cannot use the `env:` map when making use of a reusable
GitHub workflow with `uses:` so it's been added in the command passed to
the matrix job, itself.

### Result

The integration test CI will use this repo for the test itself so we can
make sure we're testing the right thing.

### Test Plan

The logs on _this_ PR job show that we're now cloning from the GitHub
workspace:

```
** Cloning file:///__w/swift-openapi-generator/swift-openapi-generator to /tmp/run-integration-test.sh.OWgemDungm/swift-openapi-generator
Cloning into '/tmp/run-integration-test.sh.OWgemDungm/swift-openapi-generator'...
Note: switching to '9664e9cb2170a5fa8a1bad3266891d4b4248e6ba'.
...
** Extracting name for Swift package: /__w/swift-openapi-generator/swift-openapi-generator
** Overriding dependency in /tmp/run-integration-test.sh.OWgemDungm/swift-openapi-generator/IntegrationTest on swift-openapi-generator to use /__w/swift-openapi-generator/swift-openapi-generator
```
  • Loading branch information
simonjbeaumont authored Oct 2, 2024
1 parent 0eb9afa commit 89d49d2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration test"
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
matrix_linux_5_8_enabled: false
matrix_linux_nightly_main_enabled: false

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scheduled.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
uses: apple/swift-nio/.github/workflows/swift_matrix.yml@main
with:
name: "Integration test"
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && ./scripts/run-integration-test.sh"
matrix_linux_command: "apt-get update -yq && apt-get install -yq jq && SWIFT_OPENAPI_GENERATOR_REPO_URL=file://${GITHUB_WORKSPACE} ./scripts/run-integration-test.sh"
matrix_linux_5_8_enabled: false

example-packages:
Expand Down

0 comments on commit 89d49d2

Please sign in to comment.