Skip to content

Commit

Permalink
Simplify windows test script
Browse files Browse the repository at this point in the history
  • Loading branch information
IanCa committed Jun 24, 2024
1 parent 3e7ef5c commit 50c931c
Showing 1 changed file with 1 addition and 75 deletions.
76 changes: 1 addition & 75 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,11 @@ on:
branches: ["*"]

jobs:
determine_version:
runs-on: windows-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- id: set-matrix
run: |
if [[ "${{ github.event_name }}" == 'push' && "${{ github.ref }}" == 'refs/heads/master' ]]; then
# Push to master branch
echo 'matrix=["3.8", "3.9", "3.10", "3.11"]' >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == 'pull_request' && "${{ github.event.pull_request.base.ref }}" == 'master' ]]; then
# PR to master branch
echo 'matrix=["3.8", "3.9", "3.10", "3.11"]' >> $GITHUB_OUTPUT
else
echo 'matrix=["3.9"]' >> $GITHUB_OUTPUT
fi
build:
needs: determine_version
strategy:
matrix:
platform: [windows-latest]
python-version: ${{fromJson(needs.determine_version.outputs.matrix)}}
python-version: ["3.10"]

runs-on: ${{ matrix.platform }}

Expand Down Expand Up @@ -81,59 +63,3 @@ jobs:
with:
name: code-coverage-report
path: .coverage

check-secret:
runs-on: windows-latest
outputs:
secrets-exist: ${{ steps.check-for-secrets.outputs.defined }}
steps:
- name: Check for Secret availability
id: check-for-secrets
# perform secret check & put boolean result as an output
shell: bash
run: |
if [ "${{ secrets.CC_TEST_REPORTER_ID }}" != '' ]; then
echo "defined=true" >> $GITHUB_OUTPUT;
else
echo "defined=false" >> $GITHUB_OUTPUT;
fi
coverage:
name: Publish coverage
needs: [build, check-secret]
runs-on: windows-latest
if: needs.check-secret.outputs.secrets-exist == 'true'

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.9
uses: actions/setup-python@v5
with:
python-version: 3.9

- uses: actions/cache@v4
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('docs/requirements.txt') }}

- name: Install dependencies
run: |
python -m pip install --upgrade --upgrade-strategy eager pip
pip install flake8
pip install coverage
pip install -r requirements.txt
pip install -r docs/requirements.txt
- name: Download a single artifact
uses: actions/download-artifact@v4
with:
name: code-coverage-report

- name: publish-coverages
with:
coverageCommand: coverage xml
debug: true
uses: paambaati/[email protected]
env:
CC_TEST_REPORTER_ID: ${{ secrets.CC_TEST_REPORTER_ID }}

0 comments on commit 50c931c

Please sign in to comment.