Skip to content

Commit

Permalink
internal/ci: add libcue to PATH on Windows
Browse files Browse the repository at this point in the history
Windows looks for DLLs in PATH, so add libcue to PATH.

GitHub actions don't allow setting PATH via `env`, rather we need
to append to the file pointed to by `$GITHUB_PATH`. Do this in a
separate step because this will only affect future steps.

This brings us one step closer to enabling CI on Windows, but we
don't do it in this CL yet as it requires additional work.

Updates cue-lang/cue#3253.

Signed-off-by: Aram Hăvărneanu <[email protected]>
Change-Id: I3f7e5d8acfed51961c3eaefd727ce76c3e08ae70
Reviewed-on: https://review.gerrithub.io/c/cue-lang/cue-py/+/1196833
Reviewed-by: Roger Peppe <[email protected]>
TryBot-Result: CUEcueckoo <[email protected]>
  • Loading branch information
4ad committed Jul 2, 2024
1 parent 3331227 commit b445bd4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/trybot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,9 @@ jobs:
working-directory: libcue-checkout
- name: mypy
run: mypy .
- if: runner.os == 'Windows'
name: Add libcue to PATH
run: echo '${{ github.workspace }}/libcue-checkout' >> $GITHUB_PATH
- name: pytest
run: pytest
env:
Expand Down
16 changes: 15 additions & 1 deletion internal/ci/github/trybot.cue
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ workflows: trybot: _repo.bashWorkflow & {
_buildLibcue,

_mypy,
_addLibcueToPath,
_pytest,

_repo.checkGitClean,
Expand All @@ -102,7 +103,7 @@ workflows: trybot: _repo.bashWorkflow & {
"go-version": [_repo.latestStableGo]
"python-version": [_repo.latestStablePython]

// TODO: Windows doesn't work yet, see issue #3253
// TODO: Windows doesn't work yet, see issue #3253
runner: [_repo.linuxMachine, _repo.macosMachine]
}
}
Expand Down Expand Up @@ -152,6 +153,19 @@ workflows: trybot: _repo.bashWorkflow & {
run: "mypy ."
}

_addLibcueToPath: json.#step & {
name: "Add libcue to PATH"
if: "runner.os == 'Windows'"
// On Windows LoadLibrary loads DLLs from PATH. GitHub
// actions doesn't allow setting PATH via `env`,
// rather we need to append to the file pointed to by
// `$GITHUB_PATH`. This will only affect future steps,
// so we do it before running `pytest`.
run: """
echo '${{ github.workspace }}/libcue-checkout' >> $GITHUB_PATH
"""
}

_pytest: json.#step & {
name: "pytest"
env: LD_LIBRARY_PATH: "${{ github.workspace }}/libcue-checkout"
Expand Down

0 comments on commit b445bd4

Please sign in to comment.