Skip to content

Commit b0c811d

Browse files
Merge pull request #12 from DimaBerezovskyi/secrets
speed up workflow by caching dependecies
2 parents c2f22d3 + 4819560 commit b0c811d

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

.github/workflows/run_tests.yaml

+16-11
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ jobs:
99
test:
1010
runs-on: macos-latest
1111
env:
12-
DEV_URL: ${{ vars.DEV_URL }}
13-
STAG_URL: ${{ vars.STAG_URL }}
12+
DEV_URL: ${{ secrets.DEV_URL }}
13+
STAG_URL: ${{ secrets.STAG_URL }}
1414

1515
permissions:
1616
checks: write
@@ -19,34 +19,39 @@ jobs:
1919
- name: Checkout repository
2020
uses: actions/checkout@v3
2121

22-
- name: setup Python
23-
uses: actions/setup-python@v3
22+
- name: Setup Python
23+
uses: actions/setup-python@v2
2424
with:
2525
python-version: "3.10"
2626

27-
2827
- name: Install Chrome and WebDriver
2928
run: |
3029
brew install --cask google-chrome
3130
32-
- name: Install dependencies
31+
- name: Cache dependencies
32+
uses: actions/cache@v2
3333
with:
34-
cache: pip
35-
cache-dependency-path: '**/requirements.txt'
34+
path: ~/.cache/pip
35+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
36+
restore-keys: |
37+
${{ runner.os }}-pip-
38+
39+
- name: Install dependencies
3640
run: |
3741
python -m pip install --upgrade pip
3842
pip install -r requirements.txt
3943
pip install --upgrade pytest pytest-html
40-
44+
working-directory: ${{ github.workspace }}
4145

4246
- name: Run tests
4347
run: |
4448
python -m pytest --verbose --junit-xml=test-results.xml
45-
49+
working-directory: ${{ github.workspace }}
50+
4651
- name: Publish Test Report
4752
uses: mikepenz/action-junit-report@v3
4853
if: success() || failure() # always run even if the previous step fails
4954
with:
5055
report_paths: '**/test-results.xml'
5156
detailed_summary: true
52-
include_passed: true
57+
include_passed: true

0 commit comments

Comments
 (0)