Skip to content

Commit

Permalink
chore: upgrade go and actions versions (#46)
Browse files Browse the repository at this point in the history
While there, make sure we can build the docker container by adding a new
github action that checks for that.

Closes #48.
  • Loading branch information
bassosimone authored Sep 11, 2024
1 parent 065549b commit ee9b0a0
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 171 deletions.
12 changes: 9 additions & 3 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
# Run tests and compute code coverage
name: coverage
on:
pull_request:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- uses: actions/setup-go@v5
with:
go-version: "1.20"
- uses: actions/checkout@v2
go-version: "1.23"

- uses: actions/checkout@v4

- run: go test -race -v -coverprofile=dash.cov -coverpkg=./... ./...

- uses: shogo82148/actions-goveralls@v1
with:
path-to-profile: dash.cov
parallel: true

finish:
needs: test
runs-on: ubuntu-latest
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Make sure we can build the docker container
name: docker
on:
pull_request:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- run: make buildcontainer
11 changes: 8 additions & 3 deletions .github/workflows/privacy.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
# Make sure the client doesn't run successfully without the -y flag
name: privacy
on:
pull_request:
push:

jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v1
- uses: actions/setup-go@v5
with:
go-version: "1.20"
- uses: actions/checkout@v2
go-version: "1.23"

- uses: actions/checkout@v4

- run: go build -v ./cmd/dash-client

- run: |
if ./dash-client; then
echo "expected this command to fail"
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.20 as build
FROM golang:1.23 as build
ADD . /go/src/github.com/neubot/dash
WORKDIR /go/src/github.com/neubot/dash
RUN CGO_ENABLED=0 go build -v -tags netgo -ldflags "-s -w -extldflags \"-static\"" ./cmd/dash-server
Expand Down
28 changes: 14 additions & 14 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
module github.com/neubot/dash

go 1.20
go 1.23.1

require (
github.com/apex/log v1.9.0
github.com/google/uuid v1.3.0
github.com/gorilla/handlers v1.5.1
github.com/m-lab/go v0.1.53
github.com/google/uuid v1.6.0
github.com/gorilla/handlers v1.5.2
github.com/m-lab/go v0.1.73
github.com/m-lab/ndt5-client-go v0.1.0
)

require (
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de // indirect
github.com/beorn7/perks v1.0.1 // indirect
github.com/cespare/xxhash/v2 v2.1.2 // indirect
github.com/felixge/httpsnoop v1.0.3 // indirect
github.com/golang/protobuf v1.5.2 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.2 // indirect
github.com/cespare/xxhash/v2 v2.3.0 // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/klauspost/compress v1.17.9 // indirect
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
github.com/pkg/errors v0.9.1 // indirect
github.com/prometheus/client_golang v1.13.0 // indirect
github.com/prometheus/client_model v0.2.0 // indirect
github.com/prometheus/common v0.37.0 // indirect
github.com/prometheus/procfs v0.8.0 // indirect
golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 // indirect
google.golang.org/protobuf v1.33.0 // indirect
github.com/prometheus/client_golang v1.20.3 // indirect
github.com/prometheus/client_model v0.6.1 // indirect
github.com/prometheus/common v0.59.1 // indirect
github.com/prometheus/procfs v0.15.1 // indirect
golang.org/x/sys v0.25.0 // indirect
google.golang.org/protobuf v1.34.2 // indirect
)
169 changes: 34 additions & 135 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/buildc.bash
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
set -euxo pipefail
docker build -t neubot/dash .
docker tag neubot/dash neubot/dash:$(git describe --tags --dirty)-$(date -u +%Y%m%d%H%M%S)
docker tag neubot/dash "neubot/dash:$(git describe --tags --dirty)-$(date -u +%Y%m%d%H%M%S)"
28 changes: 14 additions & 14 deletions scripts/runc.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ set -euxo pipefail
rm -f ./certs/cert.pem ./certs/key.pem
./scripts/mkcerts.bash
sudo chown root:root ./certs/*.pem
docker run --network=bridge \
--publish=80:8888 \
--publish=443:4444 \
--publish=9990:9999 \
--volume `pwd`/certs:/certs:ro \
--volume `pwd`/datadir:/datadir \
--read-only \
--cap-drop=all \
neubot/dash \
-datadir /datadir \
-http-listen-address :8888 \
-https-listen-address :4444 \
-prometheusx.listen-address :9999 \
-tls-cert /certs/cert.pem \
docker run --network=bridge \
--publish=80:8888 \
--publish=443:4444 \
--publish=9990:9999 \
--volume "$(pwd)/certs:/certs:ro" \
--volume "$(pwd)/datadir:/datadir" \
--read-only \
--cap-drop=all \
neubot/dash \
-datadir /datadir \
-http-listen-address :8888 \
-https-listen-address :4444 \
-prometheusx.listen-address :9999 \
-tls-cert /certs/cert.pem \
-tls-key /certs/key.pem

0 comments on commit ee9b0a0

Please sign in to comment.