Skip to content

Commit 5313158

Browse files
authored
Improve efficiency on CI (#194)
* CI: Add caching for pip packages to save cycles On subsequent invocations of the test suite on CI, when no dependencies have been changed, the process can make full use of the package cache, thus speeding up test runs, and skipping redundant downloads. When any dependency file changes, the cache will be busted. * CI: Improve efficiency on GHA - When pushing to the same branch on a PR, cancel running jobs of the same kind. - Allow running the job manually from the UI, using `workflow_dispatch`.
1 parent 6d288d5 commit 5313158

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/main.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
name: Mocket's CI
22

3-
on: push
3+
on:
4+
5+
# Run on all push events.
6+
push:
7+
8+
# Allow job to be triggered manually.
9+
workflow_dispatch:
10+
11+
# Cancel in-progress jobs when pushing to the same branch.
12+
concurrency:
13+
cancel-in-progress: true
14+
group: ${{ github.workflow }}-${{ github.ref }}
415

516
jobs:
617
build:
@@ -16,6 +27,10 @@ jobs:
1627
uses: actions/setup-python@v4
1728
with:
1829
python-version: ${{ matrix.python-version }}
30+
cache: 'pip'
31+
cache-dependency-path: |
32+
Pipfile
33+
setup.py
1934
- name: Install Redis
2035
run: |
2136
sudo apt install redis-server

0 commit comments

Comments
 (0)