Skip to content

fix: Predef cloning in CI #102

fix: Predef cloning in CI

fix: Predef cloning in CI #102

Workflow file for this run

name: Tests
on:
pull_request:
push:
defaults:
run:
working-directory: ./
env:
CFLAGS: -O1 -g
jobs:
Checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: ./scripts/checks/formatting.sh
- run: ./scripts/checks/headers-have-pragmas.sh
- run: ./scripts/checks/licences.sh
Tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: awalsh128/cache-apt-pkgs-action@latest
with:
packages: tup re2c lemon libxxhash-dev llvm-dev valgrind gcc g++ pkg-config libedit-dev subversion
version: 1.0
- run: |
pushd /usr/include
[ -f hedley.h ] || sudo wget https://raw.githubusercontent.com/nemequ/hedley/master/hedley.h -O ./hedley.h
predef() {
pushd /tmp
echo "Cloning predef"
git clone -n --depth=1 --filter=tree:0 https://github.com/natefoo/predef.git predef_tmp
pushd predef_tmp
echo "Sparse checking out predef"
git sparse-checkout set --no-cone predef
git checkout
ls -lah
popd
sudo mv predef_tmp/predef /usr/include/predef
rm -r predef_tmp
popd
}
[ -d predef ] || predef
popd
- name: Configure
run: cmake -B build -DCMAKE_BUILD_TYPE=Release -DCI=true
- name: Build
run: cmake --build build
- run: ./build/test-exe --lite -j
- name: Publish Test Report
uses: mikepenz/action-junit-report@v3
if: success() || failure() # always run even if the previous step fails
with:
report_paths: 'test-results.xml'
- run: valgrind --leak-check=full --error-exitcode=1 ./build/test-exe --lite