Skip to content

Commit

Permalink
User/jf/add cached ci yml (#201)
Browse files Browse the repository at this point in the history
* testing cached py27

* add echo to ci.yml

* add cache for install coverage by create a txt file to store dependencies

* update requirements.txt path

* add echo for failed tests

* add extension coverage to py2
  • Loading branch information
feng-j678 authored Jun 22, 2023
1 parent 3184c6d commit 2e5c14b
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 6 deletions.
31 changes: 25 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,19 +55,35 @@ jobs:
run: |
echo "${{ steps.getoutput.outputs.contents }}"
exit 1
codecov-python-27:
runs-on: windows-latest
needs: codecov-python-39
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python 2.7
run : |
choco install python2 -y
SETX PATH "%PATH%;C:\Python27"
- name: Restore Python 2.7 cache
uses: actions/cache@v2
with:
path: C:\Python27
key: python27-cache
- name: Install Python 2.7
shell: cmd
run: |
echo "check if python27 is not cached"
if not exist C:\Python27 (
choco install python2 -y
SETX PATH "%PATH%;C:\Python27"
)
- name: Cache dependencies
uses: actions/cache@v2
with:
path: '%UserProfile%\.cache\pip'
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install dependencies
run: pip install coverage
shell: cmd
run: pip install -r .github/workflows/requirements.txt
- name: Run extension tests
continue-on-error: true
shell: cmd
Expand All @@ -88,6 +104,8 @@ jobs:
run: |
cd ./src/core/tests
coverage xml
cd ../../extension/tests
coverage xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
with:
Expand All @@ -101,4 +119,5 @@ jobs:
if: contains( steps.getoutput.outputs.contents, 'FAILED (failures=' )
run: |
echo "${{ steps.getoutput.outputs.contents }}"
echo "There are failed tests"
exit 1
1 change: 1 addition & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
coverage

0 comments on commit 2e5c14b

Please sign in to comment.