From 0dd09b0e6298093a68be1023de6d0fff8e12158e Mon Sep 17 00:00:00 2001 From: pilinux Date: Fri, 18 Aug 2023 16:15:53 +0200 Subject: [PATCH] ci: static analysis and test build for multiple platforms - AMD64 Linux - AMD64 MacOS - AMD64 Windows - ARM64 Linux - ARM64 MacOS - ARM64 Windows --- .github/workflows/go.yml | 38 ++++++++++++++++++++++++++++++++++---- 1 file changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 53f5b0d..aab8c43 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -28,16 +28,46 @@ jobs: - name: Checkout repository uses: actions/checkout@v3 - - name: Examine source code - run: go vet -v ./... + - name: Examine source code for Linux AMD + run: GOOS=linux GOARCH=amd64 go vet -v ./... + + - name: Examine source code for MacOS AMD + run: GOOS=darwin GOARCH=amd64 go vet -v ./... + + - name: Examine source code for Windows AMD + run: GOOS=windows GOARCH=amd64 go vet -v ./... + + - name: Examine source code for Linux ARM + run: GOOS=linux GOARCH=arm64 go vet -v ./... + + - name: Examine source code for MacOS ARM + run: GOOS=darwin GOARCH=arm64 go vet -v ./... + + - name: Examine source code for Windows ARM + run: GOOS=windows GOARCH=arm64 go vet -v ./... - name: Gosec security scanner uses: securego/gosec@master with: args: -include=G102,G103,G104,G106,G107,G108,G109,G110,G111,G112,G113,G114,G201,G202,G203,G204,G205 ./... - - name: Build - run: go build -v ./... + - name: Build for Linux AMD + run: GOOS=linux GOARCH=amd64 go build -v ./... + + - name: Build for MacOS AMD + run: GOOS=darwin GOARCH=amd64 go build -v ./... + + - name: Build for Windows AMD + run: GOOS=windows GOARCH=amd64 go build -v ./... + + - name: Build for Linux ARM + run: GOOS=linux GOARCH=arm64 go build -v ./... + + - name: Build for MacOS ARM + run: GOOS=darwin GOARCH=arm64 go build -v ./... + + - name: Build for Windows ARM + run: GOOS=windows GOARCH=arm64 go build -v ./... - name: Test if: github.event_name == 'push'