From 50cb57784e2b0119a2a940f4cac9cc94fa9e79c4 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Thu, 26 May 2022 07:38:20 -0500 Subject: [PATCH] build: use GitHub actions to check code-style (#3138) --- .github/workflows/code-style.yml | 22 ++++++++++++++++++++++ README.md | 7 +------ docker-compose.yml | 13 ------------- docker/code_style/Dockerfile | 20 -------------------- 4 files changed, 23 insertions(+), 39 deletions(-) create mode 100644 .github/workflows/code-style.yml delete mode 100644 docker-compose.yml delete mode 100644 docker/code_style/Dockerfile diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 000000000..cae306b6f --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,22 @@ +name: Code Style +on: + pull_request: + push: + branches: + - main +jobs: + formatting-check: + name: Formatting Check + runs-on: ubuntu-latest + steps: + - name: Install Dependencies + run: | + sudo apt-get install clang-format-12 npm yarn + - name: Checkout + uses: actions/checkout@v3 + with: + submodules: recursive + - name: Check + working-directory: . + run: | + ./code_style.sh --check diff --git a/README.md b/README.md index 000e62664..b138b4f0f 100644 --- a/README.md +++ b/README.md @@ -75,12 +75,7 @@ If you're new to building programs from source code, this is typically easier th You would want to setup your editor to make use of the .clang-format file located in the root of this repository and the eslint/prettier rules in web/package.json. -If for some reason you are unwilling or unable to do so, there is a shell script which you could run either directly or via docker-compose: - - $ ./code_style.sh - or - $ docker-compose build --pull - $ docker-compose run --rm code_style +If for some reason you are unwilling or unable to do so, there is a shell script which you can use: `./code_style.sh` ## Sponsors diff --git a/docker-compose.yml b/docker-compose.yml deleted file mode 100644 index c96d7ad22..000000000 --- a/docker-compose.yml +++ /dev/null @@ -1,13 +0,0 @@ -version: '3' - -services: - code_style: - build: docker/code_style - volumes: - - .:/src - working_dir: /src - command: - - ./code_style.sh - - --check - environment: - HOME: /tmp diff --git a/docker/code_style/Dockerfile b/docker/code_style/Dockerfile deleted file mode 100644 index fbbb653f2..000000000 --- a/docker/code_style/Dockerfile +++ /dev/null @@ -1,20 +0,0 @@ -FROM mikedld/clang-format:12-debian AS clang_format - -FROM debian:bullseye-slim AS final - -RUN apt-get update \ - && apt-get install -y --no-install-recommends \ - ca-certificates \ - curl \ - gnupg2 \ - && curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ - && echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list \ - && apt-get update \ - && apt-get install -y --no-install-recommends \ - bash \ - nodejs \ - perl \ - yarn \ - && rm -rf /var/lib/apt/lists/* - -COPY --from=clang_format /usr/bin/clang-format /usr/bin/