From bed4a915ca29adade3396a04154607b211bbc1d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andrzej=20Bartosi=C5=84ski?= Date: Tue, 10 Dec 2024 11:07:09 +0100 Subject: [PATCH] Add compiled requirements check to GHA --- .github/workflows/build-and-release.yaml | 28 ++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build-and-release.yaml b/.github/workflows/build-and-release.yaml index b72d83de9..5b514b9ff 100644 --- a/.github/workflows/build-and-release.yaml +++ b/.github/workflows/build-and-release.yaml @@ -40,6 +40,34 @@ jobs: - name: Run flake8 run: flake8 + check-compiled-requirements: + runs-on: arc-amd64-runners + if: ${{ !contains(github.event.head_commit.message, '#notests') }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.ref }} + - uses: actions/setup-python@v5 + with: + python-version: '3.12.3' + + - name: Prepare environment + run: | + pip install --no-deps -r requirements/requirements-pip.txt + pip install $(grep -rwoh requirements -e 'pip-tools==.*[^\]' | head -n 1) + + - name: Compile Requirements Files + run: | + ./scripts/pip-compile-all.sh + + - name: Check If Output Matches Committed + run: | + DIFF="$(git diff)" + if [ "$DIFF" ]; then + echo "Compiled requirements differ from committed requirements!" + echo "$DIFF" + exit 1 + fi build: runs-on: ${{ matrix.runs-on }}