Skip to content

Add support for crypto:hash/2 #1938

Add support for crypto:hash/2

Add support for crypto:hash/2 #1938

#
# Copyright 2022 Davide Bettio <davide@uninstall.it>
#
# 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@v2
- 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"
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"
run: |
cd libs/exavmlib/
mix format --check-formatted