chronos-forecasting/.github/workflows/ci.yml
Adnan Khan a52d460f04
Scope down GitHub token permissions (#328)
*Issue #, if available:*

*Description of changes:*

Scope down GitHub token permissions for GHA security best practices.

By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice.
2025-10-21 07:48:03 +02:00

56 lines
1.4 KiB
YAML

name: CI
on:
push:
branches: ["main"] # Run only on main branch
pull_request:
branches: ["**"] # Run on any branch
schedule:
- cron: "0 8 * * *" # Run at 8 AM UTC
permissions:
contents: read
jobs:
type-check:
strategy:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.11"]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install ".[typecheck]" -f https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Type checks with mypy
run: mypy src test
test:
strategy:
max-parallel: 4
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
platform: [ubuntu-latest]
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: pip install ".[test]" -f https://download.pytorch.org/whl/cpu/torch_stable.html
- name: Test with pytest
run: pytest