Skip to content

Commit

Permalink
ci: add e2e test step for windows
Browse files Browse the repository at this point in the history
Adds a workflow step to run e2e tests on the Windows runner.
There are TODOs included to be addressed before a merge with the
main branch. For now, this will live in the windev branch to
enable CI there.

Signed-off-by: Gavin Inglis <[email protected]>
  • Loading branch information
ginglis13 committed Sep 29, 2023
1 parent 497387e commit 64b21d4
Showing 1 changed file with 88 additions and 5 deletions.
93 changes: 88 additions & 5 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,16 @@ name: CI
on:
push:
branches:
- main
# TODO: revert to main on merge of windev branch with main
- windev
paths-ignore:
- '**.md'
- 'contrib/**'
- '.github/CODEOWNERS'
pull_request:
branches:
- main
# TODO: revert to main on merge of windev branch with main
- windev
paths-ignore:
- '**.md'
- 'contrib/**'
Expand All @@ -26,19 +28,39 @@ concurrency:

jobs:
gen-code-no-diff:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
[
[self-hosted, macos, amd64, 13, test],
[self-hosted, windows, amd64, test],
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
go-version-file: go.mod
cache: true
- run: make gen-code
- run: git diff --exit-code
unit-tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os:
[
[self-hosted, macos, amd64, 13, test],
[self-hosted, windows, amd64, test],
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- uses: actions/setup-go@v4
with:
# Since this repository is not meant to be used as a library,
Expand Down Expand Up @@ -94,6 +116,7 @@ jobs:
cache: true
- run: make check-licenses
e2e-tests:
if: github.event.name == 'TODO skipping now to expedite windows ci'
strategy:
fail-fast: false
matrix:
Expand All @@ -111,7 +134,7 @@ jobs:
# We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail.
fetch-depth: 0
persist-credentials: false
submodules: true
submodules: recursive
- name: Set output variables
id: vars
run: |
Expand Down Expand Up @@ -149,6 +172,66 @@ jobs:
git clean -f -d
REGISTRY=${{ steps.vars.outputs.has_creds == true && env.REGISTRY || '' }} make test-e2e
shell: zsh {0}
windows-e2e-tests:
strategy:
fail-fast: false
matrix:
os:
[
[self-hosted, windows, amd64, test],
]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
with:
# We need to get all the git tags to make version injection work. See VERSION in Makefile for more detail.
fetch-depth: 0
persist-credentials: false
submodules: true
# - name: Set output variables
# id: vars
# run: |
# has_creds=${{ github.event_name == 'push' || github.repository == github.event.pull_request.head.repo.full_name }}
# echo "has_creds=$has_creds" >> $GITHUB_OUTPUT
# - name: configure aws credentials
# uses: aws-actions/configure-aws-credentials@v4
# if: steps.vars.outputs.has_creds == true
# with:
# role-to-assume: ${{ secrets.ROLE }}
# role-session-name: credhelper-test
# aws-region: ${{ secrets.REGION }}
- name: Run some WSL commands
which wsl
wsl --list --verbose

Invoke-Expression "& 'C:\Program Files\WSL\wsl.exe' --list --verbose"

- name: Clean up previous files
run: |
make clean
cd deps/finch-core && make clean
- name: Build project
run: |
make
- name: Run e2e tests
run: |
# Wrap wsl as alias to pre-release WSL
$wslwrapper = @'
$argstr=[string]$Args
powershell "&'C:\Program Files\WSL\wsl.exe' '$argstr'" -RunAsAdmin
'@
# Write PowerShell 7 script to file
$wslwrapper | Out-File C:\wsl-wrapper.ps1
C:\wsl-wrapper.ps1 --list --verbose
# Set-Alias -Name wsl -Value C:\wsl-wrapper.ps1
# wsl --list --verbose
# $env:Path = "C:\Program Files\WSL\;" + $env:Path
# which wsl
# wsl --list --verbose
mdlint:
runs-on: ubuntu-latest
steps:
Expand Down

0 comments on commit 64b21d4

Please sign in to comment.