From 76fb5540fa45adb059a3e71df9aa2033f590bd8e Mon Sep 17 00:00:00 2001 From: Grant Nelson Date: Thu, 13 Jun 2024 16:35:12 -0600 Subject: [PATCH] attempt to understand gha --- .github/workflows/windows-test.yml | 31 ++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/.github/workflows/windows-test.yml b/.github/workflows/windows-test.yml index 560ffe4b8..459d46f68 100644 --- a/.github/workflows/windows-test.yml +++ b/.github/workflows/windows-test.yml @@ -29,16 +29,16 @@ jobs: with: node-version: ${{ env.NODE_VERSION }} - uses: actions/checkout@v3 - - name: Set up environment + - name: Fix TEMP variable + # Fix TEMP variable, see https://github.com/actions/runner-images/issues/712#issuecomment-613004302 run: | - # Fix TEMP variable, see https://github.com/actions/runner-images/issues/712#issuecomment-613004302 echo "TEMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV echo "TMP=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV echo "TMPDIR=$env:USERPROFILE\AppData\Local\Temp" >> $env:GITHUB_ENV - + - name: Set up environment + run: | # Make nodejs able to require installed modules from any working path. echo "NODE_PATH=$(npm root)" >> $GITHUB_ENV - echo ::notice::$(npm root) echo ::notice::$(go version) echo ::notice::$(node -v) @@ -51,4 +51,27 @@ jobs: run: | gopherjs build -v net/http gopherjs test -v --short fmt sort ./tests + - name: go test ... + run: | + $ErrorActionPreference = "Stop" + go test -v -race $(go list ./...) + - name: TodoMVC in GOPATH mode + run: | + $ErrorActionPreference = "Stop" + $env:GO111MODULE = "off" + if (-not (Test-Path ${{ env.GOPHERJS_PATH }})) { + New-Item -ItemType Directory -Force -Path ${{ env.GOPHERJS_PATH }} + } + Copy-Item -Recurse -Path . -Destination ${{ env.GOPHERJS_PATH }} + go get -v github.com/gopherjs/todomvc + gopherjs build -v -o C:\tmp\todomvc_gopath.js github.com/gopherjs/todomvc + gopherjs test -v github.com/gopherjs/todomvc/... + - name: TodoMVC in Modules mode + run: | + $ErrorActionPreference = "Stop" + Set-Location C:\tmp + git clone --depth=1 https://github.com/gopherjs/todomvc.git + Set-Location C:\tmp\todomvc + gopherjs build -v -o C:\tmp\todomvc_gomod.js github.com/gopherjs/todomvc + gopherjs test -v github.com/gopherjs/todomvc/...