Skip to content

Commit

Permalink
Merge pull request #461 from Seanstoppable/ssmith/aligngoversion
Browse files Browse the repository at this point in the history
Try to align golang around a single version
  • Loading branch information
phillip-stephens authored Aug 26, 2024
2 parents 6cdc779 + 4de1177 commit 82b0038
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 449 deletions.
34 changes: 25 additions & 9 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,21 @@ jobs:
name: Go Test
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4

- name: Read go version
id: go_version
run: |
# Read the variable from the file
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
# Set the variable as an output
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18

- name: Check out source
uses: actions/checkout@v4
go-version: ${{ steps.go_version.outputs.GO_VERSION }}

- name: Build
run: |
Expand All @@ -31,13 +39,21 @@ jobs:
name: Integration Test
runs-on: ubuntu-latest
steps:
- name: Check out source
uses: actions/checkout@v4

- name: Read go version
id: go_version
run: |
# Read the variable from the file
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
# Set the variable as an output
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18

- name: Check out source
uses: actions/checkout@v4
go-version: ${{ steps.go_version.outputs.GO_VERSION }}

- name: Install dependencies
run: |
Expand All @@ -55,4 +71,4 @@ jobs:
- name: Run tests
run: |
make integration-test
make integration-test
9 changes: 8 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Read go version
id: go_version
run: |
# Read the variable from the file
GO_VERSION=$(grep '^go ' go.mod | awk '{print $2}')
# Set the variable as an output
echo "GO_VERSION=$GO_VERSION" >> $GITHUB_OUTPUT
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.18
go-version: ${{ steps.go_version.outputs.GO_VERSION }}
- name: Run go fmt
run: |
NON_COMPLIANT_FILES=$(gofmt -s -l $(find . -type f -name '*.go'| grep -v "/.template/"))
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
## Build image ##
FROM golang:1.20.4-alpine3.16 as build
ARG GO_VERSION=1.20
FROM golang:${GO_VERSION}-alpine3.16 as build

# System dependencies
RUN apk add --no-cache make
Expand Down
22 changes: 16 additions & 6 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,10 @@
module github.com/zmap/zgrab2

go 1.12
go 1.20

require (
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/hdm/jarm-go v0.0.7
github.com/prometheus/client_golang v1.14.0
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rabbitmq/amqp091-go v1.9.0
github.com/sirupsen/logrus v1.9.0
github.com/zmap/zcrypto v0.0.0-20230310154051-c8b263fd8300
Expand All @@ -17,8 +13,22 @@ require (
golang.org/x/net v0.25.0
golang.org/x/sys v0.20.0
golang.org/x/text v0.15.0
google.golang.org/protobuf v1.33.0 // indirect
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c
gopkg.in/mgo.v2 v2.0.0-20190816093944-a6b53ec6cb22
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/kr/pretty v0.2.1 // indirect
github.com/kr/text v0.1.0 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/prometheus/client_model v0.3.0 // indirect
github.com/prometheus/common v0.42.0 // indirect
github.com/prometheus/procfs v0.9.0 // indirect
github.com/weppos/publicsuffix-go v0.30.0 // indirect
github.com/zmap/rc2 v0.0.0-20190804163417-abaa70531248 // indirect
google.golang.org/protobuf v1.33.0 // indirect
)
Loading

0 comments on commit 82b0038

Please sign in to comment.