Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: add windows coverage #307

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bcr/presubmit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ bcr_test_module:
matrix:
bazel: ["6.x", "7.x"]
# TODO(#97): add windows
platform: ["debian10", "ubuntu2004"]
platform: ["debian10", "ubuntu2004", "windows"]
tasks:
test_linux:
name: "Run test module"
Expand Down
37 changes: 23 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,20 @@ jobs:
env:
TC_CLOUD_TOKEN: ${{ secrets.TC_CLOUD_TOKEN }}
steps:
- id: linux
run: echo "os=ubuntu-latest" >> $GITHUB_OUTPUT
- id: macos
run: echo "os=macos-13" >> $GITHUB_OUTPUT
# Don't run MacOS if there is no TestContainers API token which is the case on forks. We need it for container tests.
if: ${{ env.TC_CLOUD_TOKEN != '' }}
# disable these until we get it green
# - id: linux
# run: echo "os=ubuntu-latest" >> $GITHUB_OUTPUT
# - id: macos
# run: echo "os=macos-13" >> $GITHUB_OUTPUT
# # Don't run MacOS if there is no TestContainers API token which is the case on forks. We need it for container tests.
# if: ${{ env.TC_CLOUD_TOKEN != '' }}
- id: windows
run: echo "os=windows-latest" >> $GITHUB_OUTPUT
# Only run on main branch (not PRs) to minimize windows minutes (billed at 2X)
# https://docs.github.com/en/billing/managing-billing-for-github-actions/about-billing-for-github-actions#included-storage-and-minutes
if: (github.ref == 'refs/heads/main' || contains(github.head_ref, 'windows'))
outputs:
# Will look like ["ubuntu-latest", "macos-13"]
# Will look like ["ubuntu-latest", "macos-latest", "windows-latest"]
os: ${{ toJSON(steps.*.outputs.os) }}

test:
Expand Down Expand Up @@ -77,9 +83,17 @@ jobs:
# e2e/assertion is bzlmod only but it has test for both cases.
- folder: e2e/assertion
bzlmodEnabled: false
# Windows is mostly broken, so we allow-list below instead.
- os: windows-latest
# TODO: fix
- folder: e2e/wasm
bzlmodEnabled: true
include:
# This is approx. what the BCR presubmit will run
- os: windows-latest
bzlmodEnabled: true
folder: e2e/smoke

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
Expand Down Expand Up @@ -112,7 +126,7 @@ jobs:

- name: Setup crane for credential helpers to use
uses: imjasonh/[email protected]
if: matrix.bazelversion == '6.4.0' && matrix.folder == '.'
if: matrix.bazelversion == '6.4.0' && matrix.folder == '.' && matrix.os != 'windows-latest'
with:
version: "v0.19.1"

Expand Down Expand Up @@ -161,9 +175,4 @@ jobs:
# Bazelisk will download bazel to here, ensure it is cached between runs.
XDG_CACHE_HOME: ~/.cache/bazel-repo
run: |
bazel \
--bazelrc=$GITHUB_WORKSPACE/.github/workflows/ci.bazelrc \
--bazelrc=.bazelrc \
test //... \
${{ steps.set_bzlmod_flag.outputs.bzlmod_flag }} \
${{ steps.set_credential_helper_flag.outputs.credential_helper_flag }}
bazel --bazelrc=${{ github.workspace }}/.github/workflows/ci.bazelrc --bazelrc=.bazelrc test //... ${{ steps.set_bzlmod_flag.outputs.bzlmod_flag }} ${{ steps.set_credential_helper_flag.outputs.credential_helper_flag }}
Loading