Merge pull request #772 from pguyot/w33/optimize-temp-stack #2207
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Copyright 2022 Davide Bettio <[email protected]> | |
# | |
# SPDX-License-Identifier: Apache-2.0 OR LGPL-2.1-or-later | |
# | |
name: "Check formatting" | |
on: | |
push: | |
paths: | |
- '.github/workflows/**' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'tests/**' | |
- '**/*.erl' | |
pull_request: | |
paths: | |
- '.github/workflows/**' | |
- 'CMakeLists.txt' | |
- 'src/**' | |
- 'tests/**' | |
- '**/*.erl' | |
jobs: | |
clang-format-check: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: 24.3 | |
elixir-version: 1.12 | |
- name: "Install run-clang-format" | |
run: | | |
wget -q -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - | |
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee -a /etc/apt/sources.list | |
echo "deb-src http://apt.llvm.org/focal/ llvm-toolchain-focal-13 main" | sudo tee -a /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install -y clang-format-13 | |
curl -sSfL https://raw.githubusercontent.com/Sarcasm/run-clang-format/master/run-clang-format.py -o run-clang-format | |
chmod +x run-clang-format | |
- name: "Check formatting with clang-format" | |
run: | | |
./run-clang-format --style=file --clang-format-executable=clang-format-13 -r src/ tests/ | |
- name: "Check formatting with Erlang fmt" | |
if: success() || failure() | |
run: | | |
cd .. | |
git clone --depth 1 -b v1.1.0 https://github.com/WhatsApp/erlfmt.git | |
cd erlfmt | |
rebar3 as release escriptize | |
cd ../AtomVM | |
find . -name *.erl | xargs ../erlfmt/_build/release/bin/erlfmt -c | |
- name: "Check formatting with Elixir mix format" | |
if: success() || failure() | |
run: | | |
cd libs/exavmlib/ | |
mix format --check-formatted | |
- name: "Check formatting with prettier" | |
if: success() || failure() | |
run: | | |
npm install prettier | |
find ../src/platforms/emscripten/ ../examples/emscripten/ -name "*.js" -o -name "*.html" | xargs npx prettier -c |