Skip to content

ci: fix The workflow is not valid #9

ci: fix The workflow is not valid

ci: fix The workflow is not valid #9

Workflow file for this run

name: Code Coverage
on:
workflow_dispatch:
push:
branches:
- master
- dev
paths:
- ".github/actions/setup-python/**"
- ".github/workflows/codecov.yml"
- "pydglab_ws/**"
- "tests/**"
- "pyproject.toml"
- "poetry.lock"
pull_request:
paths:
- ".github/actions/setup-python/**"
- ".github/workflows/codecov.yml"
- "pydglab_ws/**"
- "tests/**"
- "pyproject.toml"
- "poetry.lock"
jobs:
test:
name: Test With Coverage
runs-on: ${{ matrix.os }}
# macos-latest only supporting newer versions of Python
# Use macos-13 because it seems that Pydantic currently not support macOS ARM64 on 3.11, 3.12
if: ${{ (matrix.os != "macos-latest" || contains(["3.11", "3.12"], matrix.python-version)) && (matrix.os != "macos-13" || !contains(["3.11", "3.12"], matrix.python-version)) }}

Check failure on line 32 in .github/workflows/codecov.yml

View workflow run for this annotation

GitHub Actions / Code Coverage

Invalid workflow file

The workflow is not valid. .github/workflows/codecov.yml (Line: 32, Col: 9): Unrecognized named-value: 'matrix'. Located at position 2 within expression: (matrix.os != "macos-latest" || contains(["3.11", "3.12"], matrix.python-version)) && (matrix.os != "macos-13" || !contains(["3.11", "3.12"], matrix.python-version))
concurrency:
group: test-coverage-${{ github.ref }}-${{ matrix.os }}-${{ matrix.python-version }}
cancel-in-progress: true
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
# macos-14 aka. macos-latest has switched to being an ARM runner, only supporting newer versions of Python.
# https://github.com/actions/setup-python/issues/855#issuecomment-2096792205
os: [ubuntu-latest, windows-latest, macos-13, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v4
- name: Setup Python environment
uses: ./.github/actions/setup-python
with:
python-version: ${{ matrix.python-version }}
- name: Run Pytest
run: |
poetry run pytest -v --capture=sys --cov --cov-report=xml tests/
- name: Upload coverage report
uses: codecov/codecov-action@v4
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: coverage.xml
flags: ${{ matrix.os }}-${{ matrix.python-version }}