Skip to content

Update module github.com/envoyproxy/go-control-plane to v0.13.1 #342

Update module github.com/envoyproxy/go-control-plane to v0.13.1

Update module github.com/envoyproxy/go-control-plane to v0.13.1 #342

Workflow file for this run

name: CI
on:
push:
branches:
- main
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
pull_request:
branches:
- main
jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
arch: [amd64, arm64]
exclude:
- os: windows-latest
arch: arm64
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.22.2'
- name: Cache Go modules
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
# Non-Windows specific steps
- name: Generate hash of .tool-versions
if: runner.os != 'Windows'
id: generate_hash
run: echo "hash=$(sha256sum .tool-versions | cut -d ' ' -f 1)" >> $GITHUB_ENV
- name: Cache asdf tools
if: runner.os != 'Windows'
uses: actions/cache@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
with:
path: ~/.asdf
key: ${{ runner.os }}-asdf-${{ steps.generate_hash.outputs.hash }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install asdf plugins
if: runner.os != 'Windows'
uses: asdf-vm/actions/plugins-add@05e0d2ed97b598bfce82fd30daf324ae0c4570e6 # v3.0.2
- name: Install tools from .tool-versions
if: runner.os != 'Windows'
run: asdf install
- name: Install dependencies on Windows
if: runner.os == 'Windows'
run: |
choco install go-task --version=3.37.2 -y
choco install age.portable
choco install sops
- name: Install dependencies
run: task setup
- name: Run tests
run: task test
- name: Build Windsor CLI on macOS/Linux
if: runner.os != 'Windows'
run: |
VERSION=$(echo "${GITHUB_REF}" | sed 's/refs\/heads\///' | sed 's/refs\/tags\///')
echo "Building version: $VERSION"
COMMIT_SHA=${{ github.sha }}
if [ "${{ matrix.os }}" == "ubuntu-latest" ]; then
GOOS=linux GOARCH=${{ matrix.arch }} go build -ldflags "-X 'cmd.version=$VERSION' -X 'cmd.commitSHA=$COMMIT_SHA'" -o dist/windsor-linux-${{ matrix.arch }} cmd/windsor/main.go
elif [ "${{ matrix.os }}" == "macos-latest" ]; then
GOOS=darwin GOARCH=${{ matrix.arch }} go build -ldflags "-X 'cmd.version=$VERSION' -X 'cmd.commitSHA=$COMMIT_SHA'" -o dist/windsor-darwin-${{ matrix.arch }} cmd/windsor/main.go
fi
- name: Build Windsor CLI on Windows
if: runner.os == 'Windows'
run: |
$env:VERSION = $env:GITHUB_REF -replace 'refs/heads/', '' -replace 'refs/tags/', ''
echo "Building version: $env:VERSION"
$env:COMMIT_SHA = "${{ github.sha }}"
$env:GOOS = "windows"
$env:GOARCH = "${{ matrix.arch }}"
go build -ldflags "-X 'cmd.version=$env:VERSION' -X 'cmd.commitSHA=$env:COMMIT_SHA'" -o dist/windsor.exe cmd/windsor/main.go
shell: pwsh
- name: Upload Artifacts to Release (Windows)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@c062e08bd532815e2082a85e87e3ef29c3e6d191 # v2.0.8
with:
files: |
dist/windsor*
tag_name: ${{ github.ref_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
sast-scan:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
- name: Set up Go
uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.22.2'
- name: Run Gosec Security Scanner
uses: securego/gosec@d4617f51baf75f4f809066386a4f9d27b3ac3e46 # v2.21.4
with:
args: ./...