From ca0da3d4907df931636b8fa46aeb17d8ee799aa4 Mon Sep 17 00:00:00 2001 From: Christopher Haster Date: Thu, 20 Apr 2023 03:54:08 -0500 Subject: [PATCH] Added compatibility testing on pull-request to GitHub test action This uses the "github.event.pull_request.base.ref" variable as the "lfsp" target for compatibility testing. --- .github/workflows/test.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6ebe4a63..2cee3528 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -473,6 +473,42 @@ jobs: path: status retention-days: 1 + # run compatibility tests using the current master as the previous version + test-compat: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v2 + if: ${{github.event_name == 'pull_request'}} + # checkout the current pr target into lfsp + - uses: actions/checkout@v2 + if: ${{github.event_name == 'pull_request'}} + with: + ref: ${{github.event.pull_request.base.ref}} + path: lfsp + - name: install + if: ${{github.event_name == 'pull_request'}} + run: | + # need a few things + sudo apt-get update -qq + sudo apt-get install -qq gcc python3 python3-pip + pip3 install toml + gcc --version + python3 --version + # adjust prefix of lfsp + - name: changeprefix + if: ${{github.event_name == 'pull_request'}} + run: | + ./scripts/changeprefix.py lfs lfsp lfsp/*.h lfsp/*.c + - name: test-compat + if: ${{github.event_name == 'pull_request'}} + run: | + TESTS=tests/test_compat.toml \ + SRC="$(find . lfsp -name '*.c' -maxdepth 1 \ + -and -not -name '*.t.*' \ + -and -not -name '*.b.*')" \ + CFLAGS="-DLFSP=lfsp/lfsp.h" \ + make test + # self-host with littlefs-fuse for a fuzz-like test fuse: runs-on: ubuntu-22.04