From b225c021dce2fb38f71bd80fe3f211ebff6e7822 Mon Sep 17 00:00:00 2001 From: IIITM-Jay Date: Sat, 9 Nov 2024 14:15:57 +0530 Subject: [PATCH 1/4] speed up CI/ CD pipelines --- .github/workflows/python-app.yml | 17 +++++++++++------ .github/workflows/tests.yml | 9 +++++++++ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 58d125ca..b5364ed9 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,14 +21,19 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Coverage - run: | - pip3 install coverage + - name: Cache pre-commit environment + uses: actions/cache@v3 + with: + path: ~/.cache/pre-commit + key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + restore-keys: | + ${{ runner.os }}-pre-commit- + + - name: Install dependencies + run: python3 -m pip install pre-commit coverage - name: Run pre-commit - run: | - python3 -m pip install pre-commit - pre-commit run --all-files + run: pre-commit run --from-ref origin/master --to-ref HEAD - name: Generate run: coverage run ./parse.py -c -chisel -sverilog -rust -latex -spinalhdl -go "rv*" "unratified/rv*" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 6615709b..7871786f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -21,9 +21,18 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Cache pip dependencies + uses: actions/cache@v3 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ matrix.python-version }}-coverage + restore-keys: | + ${{ runner.os }}-pip-${{ matrix.python-version }}- + - name: Install dependencies run: | pip3 install coverage + - name: Test error outputs run: coverage run -m unittest -b From fb32e97e0282869ece4068c513d8e0bd5a2117b9 Mon Sep 17 00:00:00 2001 From: Jay Dev Jha Date: Sat, 9 Nov 2024 14:23:52 +0530 Subject: [PATCH 2/4] Update python-app.yml Signed-off-by: Jay Dev Jha --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index b5364ed9..0ba3ac06 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -33,7 +33,7 @@ jobs: run: python3 -m pip install pre-commit coverage - name: Run pre-commit - run: pre-commit run --from-ref origin/master --to-ref HEAD + run: pre-commit run --all-files - name: Generate run: coverage run ./parse.py -c -chisel -sverilog -rust -latex -spinalhdl -go "rv*" "unratified/rv*" From 4c58e6cd6b7dc856068fd4675a327525b80dae30 Mon Sep 17 00:00:00 2001 From: Jay Dev Jha Date: Sat, 9 Nov 2024 14:49:44 +0530 Subject: [PATCH 3/4] Cache python version dependencies Signed-off-by: Jay Dev Jha --- .github/workflows/python-app.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index 0ba3ac06..e3137f4b 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -21,19 +21,22 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Cache pre-commit environment + - name: Cache pre-commit and coverage dependencies uses: actions/cache@v3 with: - path: ~/.cache/pre-commit - key: ${{ runner.os }}-pre-commit-${{ hashFiles('.pre-commit-config.yaml') }} + path: | + ~/.cache/pre-commit + ~/.cache/pip + key: ${{ runner.os }}-dependencies-${{ hashFiles('.pre-commit-config.yaml') }}-${{ matrix.python-version }} restore-keys: | - ${{ runner.os }}-pre-commit- + ${{ runner.os }}-dependencies-${{ matrix.python-version }}- + ${{ runner.os }}-dependencies- - name: Install dependencies run: python3 -m pip install pre-commit coverage - name: Run pre-commit - run: pre-commit run --all-files + run: pre-commit run --from-ref origin/master --to-ref HEAD - name: Generate run: coverage run ./parse.py -c -chisel -sverilog -rust -latex -spinalhdl -go "rv*" "unratified/rv*" From 4a8edc992040bb0524f76272fb6c6db61c617b1a Mon Sep 17 00:00:00 2001 From: Jay Dev Jha Date: Sat, 9 Nov 2024 14:51:23 +0530 Subject: [PATCH 4/4] Update python-app.yml Signed-off-by: Jay Dev Jha --- .github/workflows/python-app.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/python-app.yml b/.github/workflows/python-app.yml index e3137f4b..1bdb34d8 100644 --- a/.github/workflows/python-app.yml +++ b/.github/workflows/python-app.yml @@ -36,7 +36,7 @@ jobs: run: python3 -m pip install pre-commit coverage - name: Run pre-commit - run: pre-commit run --from-ref origin/master --to-ref HEAD + run: pre-commit run --all-files - name: Generate run: coverage run ./parse.py -c -chisel -sverilog -rust -latex -spinalhdl -go "rv*" "unratified/rv*"