Skip to content

Commit 5696b04

Browse files
committed
running protos on docker
1 parent 63b2eed commit 5696b04

File tree

5 files changed

+22
-18
lines changed

5 files changed

+22
-18
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
set -x
4+
VER="20.10.19"
5+
curl -L -o /tmp/docker-$VER.tgz https://download.docker.com/linux/static/stable/x86_64/docker-$VER.tgz
6+
tar -xz -C /tmp -f /tmp/docker-$VER.tgz
7+
mkdir -vp ~/.docker/cli-plugins/
8+
curl --silent -L "https://github.com/docker/buildx/releases/download/v0.3.0/buildx-v0.3.0.linux-amd64" > ~/.docker/cli-plugins/docker-buildx
9+
chmod a+x ~/.docker/cli-plugins/docker-buildx
10+
mv /tmp/docker/* /usr/bin
11+
docker run --privileged --rm tonistiigi/binfmt --install all

.github/workflows/test-build-deploy.yml

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,17 +34,12 @@ jobs:
3434
steps:
3535
- name: Checkout Repo
3636
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
37-
- name: Setup Git safe.directory
38-
run: |
39-
echo "this step is needed because when running in container, actions/checkout does not set safe.directory effectively."
40-
echo "See https://github.com/actions/runner/issues/2033. We should use --system instead of --global"
41-
git config --system --add safe.directory $GITHUB_WORKSPACE
42-
# Commands in the Makefile are hardcoded with an assumed file structure of the CI container
43-
# Symlink ensures paths specified in previous commands don’t break
44-
- name: Sym Link Expected Path to Workspace
45-
run: |
46-
mkdir -p /go/src/github.com/cortexproject/weaveworks-common
47-
ln -s $GITHUB_WORKSPACE/* /go/src/github.com/cortexproject/weaveworks-common
37+
- name: Install Docker Client
38+
run: sudo ./.github/workflows/scripts/install-docker.sh
39+
- name: Download Docker Images Artifact
40+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
41+
with:
42+
name: Docker Images
4843
- name: CheckProtos
4944
run: make check-protos
5045

instrument/instrument_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestCollectedRequest(t *testing.T) {
6060

6161
func TestCollectedRequest_Error(t *testing.T) {
6262
c := &spyCollector{}
63-
require.NoError(t, instrument.CollectedRequest(context.Background(), "test", c, nil, func(_ context.Context) error {
63+
require.Error(t, instrument.CollectedRequest(context.Background(), "test", c, nil, func(_ context.Context) error {
6464
return errors.New("boom")
6565
}))
6666
assert.True(t, c.before)

mflag/flag_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func TestEverything(t *testing.T) {
8585
require.NoError(t, Set("test_uint64", "1"))
8686
require.NoError(t, Set("test_string", "1"))
8787
require.NoError(t, Set("test_float64", "1"))
88-
require.NoError(t, Set("testrequire.NoError(_duration", "1s"))
88+
require.NoError(t, Set("test_duration", "1s"))
8989
desired = "1"
9090
Visit(visitor)
9191
if len(m) != 8 {
@@ -276,7 +276,7 @@ func testPanic(f *FlagSet, t *testing.T) {
276276
args := []string{
277277
"-int", "21",
278278
}
279-
require.NoError(t, f.Parse(args))
279+
f.Parse(args) //nolint:errcheck
280280
}
281281

282282
func TestParsePanic(t *testing.T) {

middleware/logging_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ func TestBadWriteLogging(t *testing.T) {
3838
Log: logging.Logrus(logrusLogger),
3939
}
4040
handler := func(w http.ResponseWriter, r *http.Request) {
41-
_, err := io.WriteString(w, "<html><body>Hello World!</body></html>")
42-
require.NoError(t, err)
41+
io.WriteString(w, "<html><body>Hello World!</body></html>") //nolint:errcheck
4342
}
4443
loggingHandler := loggingMiddleware.Wrap(http.HandlerFunc(handler))
4544

@@ -129,8 +128,7 @@ func TestLoggingRequestsAtInfoLevel(t *testing.T) {
129128
LogRequestAtInfoLevel: true,
130129
}
131130
handler := func(w http.ResponseWriter, r *http.Request) {
132-
_, err := io.WriteString(w, "<html><body>Hello World!</body></html>")
133-
require.NoError(t, err)
131+
io.WriteString(w, "<html><body>Hello World!</body></html>") //nolint:errcheck
134132
}
135133
loggingHandler := loggingMiddleware.Wrap(http.HandlerFunc(handler))
136134

0 commit comments

Comments
 (0)