mirror of
https://github.com/amazon-science/chronos-forecasting
synced 2026-05-23 09:39:35 +00:00
*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.
56 lines
1.4 KiB
YAML
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
|