fix(initrd): Ensure proper ordering and checks of (docker)files (#1964) #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: tools/protoc-gen-go-netconn | |
on: | |
push: | |
branches: [stable] | |
pull_request: | |
types: [opened, synchronize, reopened] | |
branches: [staging] | |
paths: | |
- 'tools/protoc-gen-go-netconn/**' | |
- '.github/workflows/gobuild-protoc.yaml' | |
jobs: | |
# This job must run on the runner because hashFiles() operates on the runner | |
# by design, not inside the defined container (actions/runner#837). | |
go-vars: | |
runs-on: ubuntu-latest | |
outputs: | |
modhash: ${{ steps.gomod.outputs.hash }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.3 | |
cache: false | |
- name: Set go.mod variable | |
id: goenv | |
run: | | |
cd tools/protoc-gen-go-netconn | |
echo "mod=$(go env GOMOD)" >>"$GITHUB_OUTPUT" | |
- name: Set go.mod hash variable | |
id: gomod | |
run: echo "hash=${{ hashFiles(steps.goenv.outputs.mod) }}" >>"$GITHUB_OUTPUT" | |
build-protoc: | |
runs-on: ubuntu-latest | |
needs: go-vars | |
container: kraftkit.sh/myself-full:latest | |
env: | |
RUNGOGENERATE: false | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- uses: actions/setup-go@v5 | |
with: | |
go-version: 1.22.3 | |
cache: false | |
- name: Set Go variables | |
id: goenv | |
run: | | |
cd tools/protoc-gen-go-netconn | |
{ | |
echo "cache=$(go env GOCACHE)" | |
echo "modcache=$(go env GOMODCACHE)" | |
} >>"$GITHUB_OUTPUT" | |
- name: Go caches | |
uses: actions/cache@v4 | |
with: | |
path: | | |
${{ steps.goenv.outputs.cache }} | |
${{ steps.goenv.outputs.modcache }} | |
key: ${{ github.job }}-${{ runner.os }}-go-${{ needs.go-vars.outputs.modhash }} | |
restore-keys: | | |
${{ github.job }}-${{ runner.os }}-go- | |
- name: Build protoc-gen-go-netconn | |
run: | | |
set -x | |
git config --global --add safe.directory /__w/kraftkit/kraftkit | |
export PATH="${GOROOT}/bin:$PATH" | |
cd tools/protoc-gen-go-netconn | |
go build -o ../../dist/ | |
- name: Run Help Message | |
run: | | |
set -x | |
./dist/protoc-gen-go-netconn -h |