mirror of
https://github.com/anchore/syft
synced 2024-09-20 06:01:53 +00:00
feat: update golang to 1.19 (#1526)
* feat: update golang to 1.19 Signed-off-by: Bradley Jones <bradley.jones@anchore.com> * chore: break out json schema drift check into separate script Signed-off-by: Alex Goodman <alex.goodman@anchore.com> * chore: update git index refresh Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com> --------- Signed-off-by: Bradley Jones <bradley.jones@anchore.com> Signed-off-by: Alex Goodman <alex.goodman@anchore.com> Signed-off-by: Christopher Phillips <christopher.phillips@anchore.com>
This commit is contained in:
parent
8dba4c33dd
commit
cdac2245b5
9 changed files with 36 additions and 12 deletions
2
.github/actions/bootstrap/action.yaml
vendored
2
.github/actions/bootstrap/action.yaml
vendored
|
@ -4,7 +4,7 @@ inputs:
|
||||||
go-version:
|
go-version:
|
||||||
description: "Go version to install"
|
description: "Go version to install"
|
||||||
required: true
|
required: true
|
||||||
default: "1.18.x"
|
default: "1.19.x"
|
||||||
use-go-cache:
|
use-go-cache:
|
||||||
description: "Restore go cache"
|
description: "Restore go cache"
|
||||||
required: true
|
required: true
|
||||||
|
|
2
.github/scripts/go-mod-tidy-check.sh
vendored
2
.github/scripts/go-mod-tidy-check.sh
vendored
|
@ -4,7 +4,7 @@ set -eu
|
||||||
ORIGINAL_STATE_DIR=$(mktemp -d "TEMP-original-state-XXXXXXXXX")
|
ORIGINAL_STATE_DIR=$(mktemp -d "TEMP-original-state-XXXXXXXXX")
|
||||||
TIDY_STATE_DIR=$(mktemp -d "TEMP-tidy-state-XXXXXXXXX")
|
TIDY_STATE_DIR=$(mktemp -d "TEMP-tidy-state-XXXXXXXXX")
|
||||||
|
|
||||||
trap "cp ${ORIGINAL_STATE_DIR}/* ./ && rm -fR ${ORIGINAL_STATE_DIR} ${TIDY_STATE_DIR}" EXIT
|
trap "cp -p ${ORIGINAL_STATE_DIR}/* ./ && git update-index -q --refresh && rm -fR ${ORIGINAL_STATE_DIR} ${TIDY_STATE_DIR}" EXIT
|
||||||
|
|
||||||
# capturing original state of files...
|
# capturing original state of files...
|
||||||
cp go.mod go.sum "${ORIGINAL_STATE_DIR}"
|
cp go.mod go.sum "${ORIGINAL_STATE_DIR}"
|
||||||
|
|
27
.github/scripts/json-schema-drift-check.sh
vendored
Executable file
27
.github/scripts/json-schema-drift-check.sh
vendored
Executable file
|
@ -0,0 +1,27 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -u
|
||||||
|
|
||||||
|
if ! git diff-index --quiet HEAD --; then
|
||||||
|
git diff-index HEAD --
|
||||||
|
git --no-pager diff
|
||||||
|
echo "there are uncommitted changes, please commit them before running this check"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
success=true
|
||||||
|
|
||||||
|
if ! make generate-json-schema; then
|
||||||
|
echo "Generating json schema failed"
|
||||||
|
success=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! git diff-index --quiet HEAD --; then
|
||||||
|
git diff-index HEAD --
|
||||||
|
git --no-pager diff
|
||||||
|
echo "JSON schema drift detected!"
|
||||||
|
success=false
|
||||||
|
fi
|
||||||
|
|
||||||
|
if ! $success; then
|
||||||
|
exit 1
|
||||||
|
fi
|
2
.github/workflows/release.yaml
vendored
2
.github/workflows/release.yaml
vendored
|
@ -9,7 +9,7 @@ on:
|
||||||
- "v*"
|
- "v*"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.18.x"
|
GO_VERSION: "1.19.x"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
quality-gate:
|
quality-gate:
|
||||||
|
|
2
.github/workflows/update-bootstrap-tools.yml
vendored
2
.github/workflows/update-bootstrap-tools.yml
vendored
|
@ -6,7 +6,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.18.x"
|
GO_VERSION: "1.19.x"
|
||||||
GO_STABLE_VERSION: true
|
GO_STABLE_VERSION: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -6,7 +6,7 @@ on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: "1.18.x"
|
GO_VERSION: "1.19.x"
|
||||||
GO_STABLE_VERSION: true
|
GO_STABLE_VERSION: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
# Contributing to Syft
|
[#](#) Contributing to Syft
|
||||||
|
|
||||||
If you are looking to contribute to this project and want to open a GitHub pull request ("PR"), there are a few guidelines of what we are looking for in patches. Make sure you go through this document and ensure that your code proposal is aligned.
|
If you are looking to contribute to this project and want to open a GitHub pull request ("PR"), there are a few guidelines of what we are looking for in patches. Make sure you go through this document and ensure that your code proposal is aligned.
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ Before you can contribute to Syft, you need to configure your development enviro
|
||||||
|
|
||||||
You will need to install Go. The version on https://go.dev works best, using the system golang doesn't always work the way you might expect.
|
You will need to install Go. The version on https://go.dev works best, using the system golang doesn't always work the way you might expect.
|
||||||
|
|
||||||
At the time of writing, Go 1.19 does not work correctly with Syft. Please use Go 1.18 for now.
|
Refer to the go.mod file in the root of this repo for the recommended version of Go to install.
|
||||||
|
|
||||||
You will also need Docker. There's no reason the system packages shouldn't work, but we used the official Docker package. You can find instructions for installing Docker in Debian [here](https://docs.docker.com/engine/install/debian/).
|
You will also need Docker. There's no reason the system packages shouldn't work, but we used the official Docker package. You can find instructions for installing Docker in Debian [here](https://docs.docker.com/engine/install/debian/).
|
||||||
|
|
||||||
|
|
5
Makefile
5
Makefile
|
@ -132,10 +132,7 @@ check-go-mod-tidy:
|
||||||
|
|
||||||
check-json-schema-drift:
|
check-json-schema-drift:
|
||||||
$(call title,Ensure there is no drift between the JSON schema and the code)
|
$(call title,Ensure there is no drift between the JSON schema and the code)
|
||||||
@git diff-index --quiet HEAD -- || (echo "there are uncommitted changes, please commit them before running this check" && false)
|
@.github/scripts/json-schema-drift-check.sh
|
||||||
@make generate-json-schema || (echo "$(RED)$(BOLD)JSON schema drift detected!$(RESET)" && false)
|
|
||||||
@git diff-index --quiet HEAD -- || (echo "$(RED)$(BOLD)JSON schema drift detected!$(RESET)" && false)
|
|
||||||
|
|
||||||
|
|
||||||
## Testing targets #################################
|
## Testing targets #################################
|
||||||
|
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module github.com/anchore/syft
|
module github.com/anchore/syft
|
||||||
|
|
||||||
go 1.18
|
go 1.19
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
|
github.com/acarl005/stripansi v0.0.0-20180116102854-5a71ef0e047d
|
||||||
|
|
Loading…
Reference in a new issue