Skip to content

Merge pull request #650 from evo-lua/msys2-permission-errors #1527

Merge pull request #650 from evo-lua/msys2-permission-errors

Merge pull request #650 from evo-lua/msys2-permission-errors #1527

name: Static Analysis
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
push:
branches:
- main
jobs:
luacheck:
name: Lint codebase
runs-on: ubuntu-24.04
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: false
- name: Set up environment
run: |
set -a
source .github/static-analysis.env
cat .github/static-analysis.env >> $GITHUB_ENV
echo $(pwd) >> $GITHUB_PATH
# LuaRocks needs the 5.1 headers to compile LuaCheck later, so we download them, too
- name: Install LuaJIT
run: sudo apt-get install luajit libluajit-5.1-dev
- name: Download LuaRocks
run: wget https://luarocks.org/releases/luarocks-$EVO_LUAROCKS_VERSION.tar.gz
- name: Unpack LuaRocks release
run: tar zxpf luarocks-$EVO_LUAROCKS_VERSION.tar.gz
- name: Install LuaRocks
run: |
cd luarocks-$EVO_LUAROCKS_VERSION
./configure
make
sudo make install
cd -
rm -rfv luarocks-$EVO_LUAROCKS_VERSION
- name: Install LuaCheck
run: sudo luarocks install luacheck $EVO_LUACHECK_VERSION
- name: Run luacheck
run: luacheck .
- name: Install selene
run: cargo install selene@$EVO_SELENE_VERSION
- name: Run selene
run: selene .
# apt only has an ancient version, which behaves inconsistently
- name: Install cppcheck
run: |
git clone --depth 1 https://github.com/danmar/cppcheck.git
cd cppcheck
git fetch --tags
git checkout $EVO_CPPCHECK_VERSION
mkdir build
cd build
cmake ..
make -j$(nproc)
sudo make install
- name: Run cppcheck
run: deps/cppcheck.sh