Skip to content
This repository has been archived by the owner on Sep 12, 2024. It is now read-only.

Commit

Permalink
Update cache configuration in CI workflow (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
fcakyon authored Nov 24, 2023
1 parent a5955f5 commit 00d8b0c
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 6 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ jobs:
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore MacOS cache
uses: actions/cache@v3
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore Windows cache
uses: actions/cache@v3
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.os }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.os }}-${{ matrix.python-version }}-
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Update pip
run: python -m pip install --upgrade pip
Expand Down
65 changes: 65 additions & 0 deletions .github/workflows/package_ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Package CI

on:
schedule:
- cron: '0 0 * * *' # Runs at 00:00 UTC every day

jobs:
build:
runs-on: ubuntu-latest

strategy:
matrix:
operating-system: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12']
fail-fast: false

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Restore Ubuntu cache
uses: actions/cache@v3
if: matrix.operating-system == 'ubuntu-latest'
with:
path: ~/.cache/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore MacOS cache
uses: actions/cache@v3
if: matrix.operating-system == 'macos-latest'
with:
path: ~/Library/Caches/pip
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Restore Windows cache
uses: actions/cache@v3
if: matrix.operating-system == 'windows-latest'
with:
path: ~\AppData\Local\pip\Cache
key: ${{ matrix.operating-system }}-${{ matrix.python-version }}-${{ hashFiles('**/setup.py')}}
restore-keys: ${{ matrix.operating-system }}-${{ matrix.python-version }}-

- name: Update pip
run: python -m pip install --upgrade pip

- name: Install local package with dev and readers dependencies
run: >
pip install -e .[dev,readers]
- name: Check styling with pre-commit
run: |
pre-commit install
pre-commit run --all-files
- name: Run tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: pytest

0 comments on commit 00d8b0c

Please sign in to comment.