Skip to content

upgraded github actions image to 22.04 (#460) #1749

upgraded github actions image to 22.04 (#460)

upgraded github actions image to 22.04 (#460) #1749

# Copyright Contributors to the L3AF Project.
# SPDX-License-Identifier: Apache-2.0
#
# For documentation on the github environment, see
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
#
# For documentation on the syntax of this file, see
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions
name: CI Windows build
on:
pull_request: {}
push:
branches:
- main
permissions:
contents: read
jobs:
build:
runs-on: windows-latest
steps:
- name: Setup Go 1.22.3
uses: actions/setup-go@df1a11710ed378b187f40c71eb3d6c08d82e7108
with:
go-version: '1.22.3'
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7
with:
egress-policy: audit # TODO: change to 'egress-policy: block' after couple of runs
- name: Set up git env
run: |
git config --global core.autocrlf false
$gopath = (go env GOPATH)
echo "GOPATH=$gopath" >> $env:GITHUB_ENV
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332
- name: Format
run: |
go install golang.org/x/tools/cmd/goimports@latest
$goimp = (Join-path -Path (go env GOPATH) -ChildPath "\bin\goimports")
$res = (&$goimp -l .) -replace "$_"
if ($res -ne "") {
echo "Unformatted source code:"
echo $res
exit 1
}
- name: Vet
run: |
go vet -tags WINDOWS ./...
- name: Test
run: |
go test -tags WINDOWS ./...
- uses: dominikh/staticcheck-action@fe1dd0c3658873b46f8c9bb3291096a617310ca6
with:
version: "2024.1.1"
install-go: false
cache-key: "1.22.x"
build-tags: WINDOWS
- name: Build
env:
GOPATH: ${{env.GOPATH}}
run: |
cmake -B build
cmake --build build