Fix Windows builds and test they compile (#543)

This commit is contained in:
Toni Spets
2023-12-15 22:57:23 +02:00
committed by GitHub
parent 6824eb61a8
commit 91ad34d709
2 changed files with 26 additions and 13 deletions

View File

@@ -20,7 +20,6 @@ jobs:
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
cache: true
- run: |
go install golang.org/x/tools/cmd/goimports@latest
@@ -29,6 +28,27 @@ jobs:
- uses: pre-commit/action@v3.0.0
build-windows:
name: Build Windows
runs-on: ubuntu-latest
steps:
- run: sudo apt-get install -y mingw-w64
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: ${{ env.GO_VERSION }}
- run: |
go build ./cmd/litestream/
file ./litestream.exe
env:
CGO_ENABLED: "1"
GOOS: windows
GOARCH: amd64
CC: x86_64-w64-mingw32-gcc
build:
name: Build & Unit Test
runs-on: ubuntu-latest
@@ -39,12 +59,6 @@ jobs:
with:
go-version: ${{ env.GO_VERSION }}
- uses: actions/cache@v2
with:
path: ~/go/pkg/mod
key: ${{ inputs.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: ${{ inputs.os }}-go-
- run: go env
- run: go install ./cmd/litestream