name: Build on: [push, pull_request] jobs: coredhcp: runs-on: ubuntu-latest strategy: matrix: go: ['1.22', '1.23'] steps: - uses: actions/checkout@v4 with: # clone in the gopath path: src/github.com/${{ github.repository }} - uses: actions/setup-go@v5 with: stable: false go-version: ${{ matrix.go }} - name: setup environment run: | # `env` doesn't allow for variable expansion, so we use the GITHUB_ENV # trick. echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV echo "GO111MODULE=on" >> $GITHUB_ENV - name: build coredhcp run: | set -exu cd $GITHUB_WORKSPACE/src/github.com/${{ github.repository }}/cmds/coredhcp go build - uses: actions/upload-artifact@v4 with: name: coredhcp-${{ matrix.go }} path: src/github.com/${{ github.repository }}/cmds/coredhcp/coredhcp if-no-files-found: error coredhcp-generator: runs-on: ubuntu-latest strategy: matrix: go: ['1.22', '1.23'] steps: - uses: actions/checkout@v4 with: # clone in the gopath path: src/github.com/${{ github.repository }} - uses: actions/setup-go@v5 with: stable: false go-version: ${{ matrix.go }} - name: setup environment run: | # `env` doesn't allow for variable expansion, so we use the GITHUB_ENV # trick. echo "GOPATH=$GITHUB_WORKSPACE" >> $GITHUB_ENV echo "GOBIN=$GITHUB_WORKSPACE/bin" >> $GITHUB_ENV - name: build coredhcp-generator run: | set -exu cd "${GITHUB_WORKSPACE}"/src/github.com/${{ github.repository }}/cmds/coredhcp-generator go build builddir=$(./coredhcp-generator -f core-plugins.txt) cd "${builddir}" ls -l go mod init "coredhcp" go mod edit -replace "github.com/coredhcp/coredhcp=${GITHUB_WORKSPACE}/src/github.com/${{ github.repository }}" go mod tidy go build gofmt -w "${builddir}/coredhcp.go" diff -u "${builddir}/coredhcp.go" "${GITHUB_WORKSPACE}"/src/github.com/${{ github.repository }}/cmds/coredhcp/main.go