Skip to content

Updated GitHub Workflows #1184

Updated GitHub Workflows

Updated GitHub Workflows #1184

Workflow file for this run

name: CI
on:
push:
branches: [main]
pull_request:
types: [labeled, opened, synchronize, reopened]
workflow_dispatch:
merge_group:
types: [checks_requested]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
permissions:
contents: read # to fetch code (actions/checkout)
jobs:
get_dataset:
env:
cache-name: dataset-cache
name: Get / Update Example Dataset
runs-on: ubuntu-latest
steps:
- name: Checkout ${{github.repository }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Restore Example Dataset Cache
uses: actions/cache@v4
with:
path: ./data/cache/
key: huggingface-${{ env.cache-name }}
enableCrossOsArchive: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache-dependency-path: "**/pyproject.toml"
cache: "pip"
- name: Check the Example Dataset Cache
run: |
pip install datasets
python ./.github/scripts/get_example_dataset.py
test:
needs: [get_dataset]
name: Test
permissions:
contents: read
pull-requests: write
secrets: inherit
uses: ./.github/workflows/test.yml
build:
name: Build
permissions:
contents: read
pull-requests: write
secrets: inherit
uses: ./.github/workflows/build.yml
upload_coverage:
needs: [test]
name: Upload Coverage
runs-on: ubuntu-latest
steps:
- name: Checkout ${{github.repository }}
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download Coverage Artifact
uses: actions/download-artifact@v4
with:
pattern: coverage-*
merge-multiple: true
- name: Upload Coverage to Coveralls
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
publish-to-testpypi:
# Test PyPI publish, requires wheels and source dist to pass
name: >-
Publish Python 🐍 distribution 📦 to TestPyPI
needs: [test, build]
runs-on: ubuntu-latest
environment:
name: testpypi
url: https://test.pypi.org/p/ark-analysis
permissions:
id-token: write # Necessary for trusted publishing
steps:
- name: Download Built Distributions 📦
uses: actions/download-artifact@v4
with:
pattern: dist-*
merge-multiple: true
path: dist
- name: Publish distributions 📦 to TestPyPI
uses: pypa/gh-action-pypi-publish@v1.9.0
with:
repository-url: https://test.pypi.org/legacy/