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: run integration tests on Windows #4076

Merged
merged 1 commit into from
May 5, 2022
Merged
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
31 changes: 12 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,17 +23,15 @@ jobs:
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update && sudo apt install build-essential
fi
shell: bash
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential
- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
- run: make all
- name: Build
run: make all
- name: Reproducible build test
run: |
make erigon
Expand All @@ -44,19 +42,17 @@ jobs:
echo >&2 "Reproducible build broken"; cat erigon1.sha256; cat erigon2.sha256; exit 1
fi
- name: Lint
if: matrix.os == 'ubuntu-20.04'
if: runner.os == 'Linux'
uses: golangci/golangci-lint-action@v3
with:
version: v1.45
skip-pkg-cache: true
skip-build-cache: true
- run: make test
- name: Test
run: make test

win:
strategy:
matrix:
os: [ windows-2019 ]
runs-on: ${{ matrix.os }}
tests-windows:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
Expand All @@ -65,11 +61,8 @@ jobs:
with:
go-version: 1.18.x
- run: choco upgrade mingw cmake -y --no-progress
- name: Build
run: |
.\wmake.ps1
make test
shell: powershell
- name: Test
run: .\wmake.ps1 && make test

docker:
runs-on: ubuntu-20.04
Expand Down
32 changes: 26 additions & 6 deletions .github/workflows/test-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,40 @@ jobs:
os: [ ubuntu-20.04, macos-11 ] # list of os: https://github.com/actions/virtual-environments
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Install dependencies on Linux
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install build-essential

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}

- name: test-integration
run: make test-integration

tests-windows:
runs-on: windows-2019

steps:
- uses: actions/checkout@v3
- run: git submodule update --init --recursive --force
- uses: actions/setup-go@v3
with:
go-version: 1.18.x
- name: Install dependencies
run: |
if [ "$RUNNER_OS" == "Linux" ]; then
sudo apt update && sudo apt install build-essential
fi
shell: bash
run: choco upgrade mingw cmake -y --no-progress

- uses: actions/cache@v3
with:
path: ~/go/pkg/mod
key: ${{ matrix.os }}-go-${{ hashFiles('**/go.sum') }}
- run: make test-integration

- name: test-integration
run: .\wmake.ps1 && make test-integration
41 changes: 13 additions & 28 deletions wmake.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,18 @@ $gitErrorText = @"

"@

$goMinMinorVersion = 18

$goErrorText = @"

Requirement Error.
You need to have Go Programming Language (aka golang) installed.
Minimum required version is 1.16
Minimum required version is 1.$goMinMinorVersion
Please visit https://golang.org/dl/ and download the appropriate
installer.
Ensure that go.exe installation
directory is properly inserted into your PATH
environment variable.

"@

Expand Down Expand Up @@ -183,20 +187,14 @@ function Get-Uninstall-Item {
# Returns : $true / $false
# -----------------------------------------------------------------------------
function Test-GO-Installed {

$Private:item = Get-Uninstall-Item "^Go\ Programming\ Language"
$Private:result = $false

if ($Private:item) {
$Private:versionMajor = [int]$item.VersionMajor
$Private:versionMinor = [int]$item.VersionMinor
if ($Private:versionMajor -ge 1 -and $Private:versionMinor -ge 16) {
Write-Host " Found GO version $($Private:item.DisplayVersion)"
$Private:result = $true
}
}

Write-Output $Private:result
$versionStr = go.exe version
if (!($?)) {
return $false
}

$minorVersionStr = $versionStr.Substring(15, 2)
$minorVersion = [int]$minorVersionStr
return ($minorVersion -ge $goMinMinorVersion)
}

# -----------------------------------------------------------------------------
Expand Down Expand Up @@ -339,19 +337,6 @@ if(!(Test-GO-Installed)) {
Write-Host $goErrorText
exit 1
}
Get-Command go.exe | Out-Null
if (!($?)) {
Write-Host @"

Error !
Though GO installation is found I could not get
the GO binary executable. Ensure GO installation
directory is properly inserted into your PATH
environment variable.

"@
exit 1
}

# ## Administrator Privileges
# if (!(Test-Administrator)) {
Expand Down