Skip to content

Commit

Permalink
Update to Go 1.22
Browse files Browse the repository at this point in the history
Signed-off-by: Rick Lane <[email protected]>
  • Loading branch information
rick-a-lane-ii committed Jun 25, 2024
1 parent ec921e4 commit 3c57d87
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 1,197 deletions.
1 change: 0 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,3 @@ DEPENDENCY_LICENSES.md
.git
.github
actions
tools
23 changes: 12 additions & 11 deletions .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,38 @@ jobs:
- macos-latest
#- windows-latest
go_version:
- '1.18.0'
- '1.19.0'
- '1.20.0'
- '1.21.0'
- '1.22.0'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '~${{ matrix.go_version }}'
cache: true
- run: |
if [[ "${{runner.debug}}" == "1" ]]; then
DEBUG_FLAGS="-v"
fi
go test -race ${DEBUG_FLAGS} ./...
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
# Specify the most recent (1.Y.Z) Y release
go-version-file: go.mod
cache: true
- run: make lint
- uses: golangci/golangci-lint-action@v5
with:
version: latest
args: --timeout=10m
generate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v3
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
name: "Generate dependency information"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go environment
uses: actions/setup-go@v3
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
Expand All @@ -37,14 +37,14 @@ jobs:
: > DEPENDENCY_LICENSES.md
: > DEPENDENCIES.md
git add DEPENDENCY_LICENSES.md DEPENDENCIES.md
# Generate license information
export GO_IMAGE=$(grep -e 'FROM golang:' "build-aux/docker/go_builder.dockerfile" | cut -d ' ' -f2 )
#Copy test data to another folder since it can't be used from there
cp -a ./test-data ./ui
export NPM_PACKAGES=$( echo -e "./ui/package.json\n./ui/package-lock.json" )
mkdir -p "${BUILD_TMP}"
build-aux/generate.sh --unparsable-packages ./unparsable-packages.yaml
Expand All @@ -58,7 +58,7 @@ jobs:
- name: "Check that action didn't do any changes"
run: |
if [[ "${{ steps.changed-by-dependabot.outputs.is_dirty }}" == 'true' ]]; then
echo "::error:: Action indicates that the repo was dirty"
echo "::error:: Action indicates that the repo was dirty"
exit 1
fi
Expand All @@ -74,18 +74,18 @@ jobs:
if: github.ref_type == 'branch'
run: |
if [[ "${{ steps.changed-by-dependabot2.outputs.license_information_committed }}" != 'true' ]]; then
echo "::error:: Action indicates that the repo was not dirty"
echo "::error:: Action indicates that the repo was not dirty"
exit 1
fi
DESTINATION_BRANCH="${GITHUB_HEAD_REF:-$GITHUB_REF_NAME}"
DIFF=$(git diff --stat --cached origin/${DESTINATION_BRANCH})
if [[ -z "${DIFF}" ]]; then
echo "::error:: There weren't any files committed."
echo "::error:: There weren't any files committed."
exit 1
fi
if ! grep -e '^\s*DEPENDENCY_LICENSES.md' <(echo "${DIFF}") > /dev/null; then
echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been."
echo "::error:: File DEPENDENCY_LICENSES.md was not modified, but it should have been."
exit 1
fi
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@ generate:
go generate ./...
.PHONY: generate

lint: tools/bin/golangci-lint
tools/bin/golangci-lint run ./...
.PHONY: lint

tools/bin/%: tools/src/%/pin.go tools/src/%/go.mod
cd $(<D) && GOOS= GOARCH= go build -o $(abspath $@) $$(sed -En 's,^import "(.*)".*,\1,p' pin.go)

.DELETE_ON_ERROR:
.PHONY: FORCE
FORCE:
2 changes: 1 addition & 1 deletion build-aux/docker/go_builder.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Go dependency scanner
########################################
ARG GO_IMAGE="base-image-unknown"
FROM golang:1.20.12-alpine3.19 as builder
FROM golang:1.22.4-alpine3.20 as builder

ENV GOCACHE=/root/.cache/go-build
RUN mkdir -p "${GOCACHE}"
Expand Down
2 changes: 1 addition & 1 deletion build-aux/docker/js_builder.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# builder for Js scanning
######################################################################
ARG NODE_IMAGE="need-a-base-image"
FROM golang:1.19-alpine3.15 as builder
FROM golang:1.22.4-alpine3.20 as builder

ENV GOCACHE=/root/.cache/go-build
RUN mkdir -p "${GOCACHE}"
Expand Down
2 changes: 1 addition & 1 deletion build-aux/docker/py_builder.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Python dependency scanner
########################################
ARG PYTHON_IMAGE="need-a-base-image"
FROM golang:1.19-alpine3.15 as builder
FROM golang:1.22.4-alpine3.20 as builder

WORKDIR /src
COPY . ./
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/datawire/go-mkopensource

go 1.21
go 1.22

require (
github.com/datawire/dlib v1.3.1
Expand Down
1 change: 0 additions & 1 deletion tools/.gitignore

This file was deleted.

183 changes: 0 additions & 183 deletions tools/src/golangci-lint/go.mod

This file was deleted.

Loading

0 comments on commit 3c57d87

Please sign in to comment.