Skip to content

Commit

Permalink
dry github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
DimaAmega committed Jun 26, 2024
1 parent afdbaa6 commit 2a8dccc
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 48 deletions.
17 changes: 17 additions & 0 deletions .github/share-actions/get-bikes-dataset-cached/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Get bikes dataset cached
runs:
using: "composite"
steps:
- uses: actions/cache@v4
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
enableCrossOsArchive: true

- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
shell: bash
22 changes: 7 additions & 15 deletions .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,13 @@ jobs:
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run:
curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
- name: Prepare test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run:
unzip Bike-Sharing-Dataset.zip -d Bike-Sharing-Dataset

- name: 🔍 Get bikes dataset cached
uses: ./.github/share-actions/get-bikes-dataset-cached

- name: Prepare Bikes dataset
run: unzip Bike-Sharing-Dataset.zip -d Bike-Sharing-Dataset

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
Expand Down
45 changes: 12 additions & 33 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,16 +87,9 @@ jobs:
needs: changed_files
if: ${{ github.event.pull_request.draft == false && needs.changed_files.outputs.evidently_any_modified == 'true' }}
steps:
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip
- uses: actions/checkout@v4
- name: 🔍 Get bikes dataset cached
uses: ./.github/share-actions/get-bikes-dataset-cached

test-minimal:
name: Test on minimal requirements
Expand All @@ -113,17 +106,10 @@ jobs:
architecture: "x64"
cache: "pip"
cache-dependency-path: requirements.min.txt
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
enableCrossOsArchive: true
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip

- name: 🔍 Get bikes dataset cached
uses: ./.github/share-actions/get-bikes-dataset-cached

- name: Update pip
run: python -m pip install --upgrade pip
- name: Install minimal dependencies
Expand Down Expand Up @@ -158,23 +144,16 @@ jobs:
architecture: "x64"
cache: "pip"
cache-dependency-path: setup.py
- uses: actions/cache@v3
- uses: actions/cache@v4
id: cache-scipy-data
with:
path: ~/scikit_learn_data
key: cache-scipy-data
enableCrossOsArchive: true
- uses: actions/cache@v3
id: cache-bikes-dataset
env:
cache-name: cache-bikes-dataset
with:
path: Bike-Sharing-Dataset.zip
key: cache-bikes-dataset
enableCrossOsArchive: true
- name: Download test data
if: ${{ steps.cache-bikes-dataset.outputs.cache-hit != 'true' }}
run: curl -k https://archive.ics.uci.edu/static/public/275/bike+sharing+dataset.zip -o Bike-Sharing-Dataset.zip

- name: 🔍 Get bikes dataset cached
uses: ./.github/share-actions/get-bikes-dataset-cached

- name: Install package
run: pip install -e .[dev,spark,fsspec]
- name: Run Tests
Expand Down

0 comments on commit 2a8dccc

Please sign in to comment.