Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[github-actions] use docker environment for lint #397

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion etc/docker/environment/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion script/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down