E2E tests execution on Windows #182
Workflow file for this run
This file contains 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: Windows-MSYS2 | |
on: | |
pull_request: | |
branches: [main, release-*] | |
push: | |
branches: [main, test*, release-*] | |
jobs: | |
build: | |
name: MSYS2 Tanzu CLI Core E2E Tests on Windows | |
runs-on: windows-latest | |
steps: | |
- name: Check out code into the Go module directory | |
uses: actions/checkout@v1 | |
- name: Set TOPLEVEL_DIR environment variable | |
run: echo "TOPLEVEL_DIR=$(git rev-parse --show-toplevel)" >> $GITHUB_ENV | |
shell: bash | |
- name: Verify Docker Desktop is running | |
run: | | |
docker --version | |
docker-compose --version | |
# Add additional steps as needed | |
- name: Set up Go 1.x | |
uses: actions/setup-go@v3 | |
with: | |
go-version: '1.21' # Ensure version is a string | |
id: go | |
- name: go cache | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/go-build | |
~/go/pkg/mod | |
key: ${{ runner.os }}-go-${{ steps.go.outputs.go-version }}-${{ hashFiles('**/go.sum') }} | |
restore-keys: | | |
${{ runner.os }}-go-${{ steps.go.outputs.go-version }}- | |
- name: Set and Echo GOPATH and GOBIN | |
run: | | |
$GOPATH = go env GOPATH | |
$GOBIN = "$GOPATH\bin" | |
echo "GOPATH 1 is set to $GOPATH" | |
echo "GOBIN 1 is set to $GOBIN" | |
echo "GOPATH=$GOPATH" | Out-File -Append -FilePath $env:GITHUB_ENV | |
echo "GOBIN=$GOBIN" | Out-File -Append -FilePath $env:GITHUB_ENV | |
echo "GOPATH 2 is set to $GOPATH" | |
echo "GOBIN 2 is set to $GOBIN" | |
shell: pwsh | |
- name: Echo Go installation path | |
run: | | |
echo "Go installation path: $(go env GOROOT)" | |
ls "$(go env GOROOT)" | |
ls "$(go env GOROOT)\bin" | |
shell: bash | |
- name: Echo GOPATH and GOBIN | |
run: | | |
echo "GOPATH=$env:GOPATH" | |
echo "GOBIN=$env:GOBIN" | |
echo "Contents of GOPATH:" | |
Get-ChildItem -Path $env:GOPATH | |
echo "Contents of GOBIN:" | |
Get-ChildItem -Path $env:GOBIN | |
shell: pwsh | |
- name: Install MSYS2 | |
run: choco install msys2 | |
shell: powershell | |
- name: Initialize MSYS2 | |
run: C:\tools\msys64\usr\bin\bash -lc "echo 'Hello from MSYS2'" | |
shell: powershell | |
- name: Install Make and Unzip in MSYS2 | |
run: | | |
C:\tools\msys64\usr\bin\bash -lc "pacman -S make unzip --noconfirm" | |
C:\tools\msys64\usr\bin\bash -lc "pacman -S make wget --noconfirm" | |
C:\tools\msys64\usr\bin\bash -lc "pacman -S make bzip2 --noconfirm" | |
C:\tools\msys64\usr\bin\bash -lc "wget --version" | |
C:\tools\msys64\usr\bin\bash -lc "bzip2 --version" | |
shell: powershell | |
- name: Run Unix Commands in MSYS2 | |
run: | | |
C:\tools\msys64\usr\bin\bash -lc "echo 'Hello from MSYS2'" | |
C:\tools\msys64\usr\bin\bash -lc "ls" | |
C:\tools\msys64\usr\bin\bash -lc "pwd" | |
C:\tools\msys64\usr\bin\bash -lc "wget --version" | |
C:\tools\msys64\usr\bin\bash -lc "bzip2 --version" | |
$WGET = $(Get-Command wget).Source | |
$BZIP2 = $(Get-Command bzip2).Source | |
echo "WGET_PATH=$WGET" >> $env:GITHUB_ENV | |
echo "BZIP2_PATH=$BZIP2" >> $env:GITHUB_ENV | |
echo "WGET_PATH: $WGET" | |
echo "BZIP2_PATH: $BZIP2" | |
$msysBin = "C:\tools\msys64\usr\bin" | |
echo "MSYS_BIN=$msysBin" >> $env:GITHUB_ENV | |
echo "PATH info: $env:PATH" | |
echo "PATH info2: $PATH" | |
shell: powershell | |
- name: Build CLI Core | |
run: | | |
make build | |
shell: powershell | |
- name: E2E Tests | |
run: | | |
C:\tools\msys64\usr\bin\bash -lc "wget --version" | |
C:\tools\msys64\usr\bin\bash -lc "bzip2 --version" | |
make e2e-cli-core | |
shell: powershell |