From ce27ca0cdb10f4b7554bdde0325101c93776eac5 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Mon, 24 Oct 2022 10:58:38 +1100 Subject: [PATCH 1/3] use docker environment for lint --- .github/workflows/lint.yml | 3 ++- etc/docker/playground/Dockerfile | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 90cee13a..5e74b961 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -55,4 +55,5 @@ jobs: - uses: actions/checkout@v2 - name: Check pretty run: | - ./script/check-pretty + docker build -t otns-env -f etc/docker/environment/Dockerfile . + docker run -t -v$PWD:/otns otns-env -c "./script/check-pretty" diff --git a/etc/docker/playground/Dockerfile b/etc/docker/playground/Dockerfile index dd2fe236..c73fb32e 100644 --- a/etc/docker/playground/Dockerfile +++ b/etc/docker/playground/Dockerfile @@ -36,7 +36,7 @@ RUN strip /openthread/output/simulation/bin/ot-cli-ftd FROM golang:1.17-buster RUN apt-get update -RUN apt-get install -y python3 python3-pip unzip +RUN apt-get install -y python3 python3-pip unzip snapd COPY . /otns WORKDIR /otns From 9b8b7b67a002c193a4d7f79d41f0a4148b80673e Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Mon, 24 Oct 2022 11:17:02 +1100 Subject: [PATCH 2/3] snap install shfmt --- script/utils.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/script/utils.sh b/script/utils.sh index 2d52ffa3..45d1fa25 100644 --- a/script/utils.sh +++ b/script/utils.sh @@ -107,7 +107,8 @@ function install_pretty_tools() curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "$(go env GOPATH)"/bin v1.47.2 fi - install_package shfmt --brew shfmt + snap install shfmt + install_package shfmt --brew shfmt || true install_package shellcheck --apt shellcheck --brew shellcheck } From 0f1fdc2dd1358e86e5205dbd91fd48e112e090a7 Mon Sep 17 00:00:00 2001 From: Simon Lin Date: Mon, 24 Oct 2022 11:39:24 +1100 Subject: [PATCH 3/3] snap install shfmt --- etc/docker/environment/Dockerfile | 2 +- etc/docker/playground/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etc/docker/environment/Dockerfile b/etc/docker/environment/Dockerfile index 721886fd..9c5aa30d 100644 --- a/etc/docker/environment/Dockerfile +++ b/etc/docker/environment/Dockerfile @@ -26,7 +26,7 @@ FROM golang:1.17-buster -RUN apt-get update && apt-get install -y python3 python3-pip sudo unzip nodejs npm git && rm -rf /var/lib/apt/lists/* +RUN apt-get update && apt-get install -y python3 python3-pip sudo unzip nodejs npm git snapd && rm -rf /var/lib/apt/lists/* COPY . /otns WORKDIR /otns diff --git a/etc/docker/playground/Dockerfile b/etc/docker/playground/Dockerfile index c73fb32e..dd2fe236 100644 --- a/etc/docker/playground/Dockerfile +++ b/etc/docker/playground/Dockerfile @@ -36,7 +36,7 @@ RUN strip /openthread/output/simulation/bin/ot-cli-ftd FROM golang:1.17-buster RUN apt-get update -RUN apt-get install -y python3 python3-pip unzip snapd +RUN apt-get install -y python3 python3-pip unzip COPY . /otns WORKDIR /otns