Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,12 @@ on:
paths:
- "src/**"
- "test/**"
schedule:
# Runs at 00:00 UTC daily
- cron: '0 0 * * *'
workflow_dispatch: # Enables manual trigger

concurrency:
# This causes it to cancel previous in-progress actions on the same PR / branch,
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

Expand Down Expand Up @@ -46,6 +49,7 @@ jobs:
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
REBUILD_IMAGE: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

steps:
- name: Checkout code
Expand All @@ -71,6 +75,7 @@ jobs:
env:
MODAL_TOKEN_ID: ${{ secrets.MODAL_TOKEN_ID }}
MODAL_TOKEN_SECRET: ${{ secrets.MODAL_TOKEN_SECRET }}
REBUILD_IMAGE: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }}

steps:
- name: Checkout code
Expand Down
7 changes: 6 additions & 1 deletion dev/modal/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@

ROOT_PATH = Path(__file__).parent.parent.parent

# REBUILD_IMAGE is an environment variable that is set to "true" in the nightly build
REBUILD_IMAGE = modal.env("REBUILD_IMAGE", default=False)

image = modal.Image.debian_slim().pip_install_from_pyproject(
ROOT_PATH / "pyproject.toml", optional_dependencies=["dev"]
ROOT_PATH / "pyproject.toml",
optional_dependencies=["dev"],
force_build=REBUILD_IMAGE,
)

app = modal.App("liger_tests", image=image)
Expand Down
9 changes: 7 additions & 2 deletions dev/modal/tests_bwd.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,18 @@

ROOT_PATH = Path(__file__).parent.parent.parent

# REBUILD_IMAGE is an environment variable that is set to "true" in the nightly build
REBUILD_IMAGE = modal.env("REBUILD_IMAGE", default=False)

# tests_bwd is to ensure the backward compatibility of liger with older transformers
image = (
modal.Image.debian_slim()
.pip_install_from_pyproject(
ROOT_PATH / "pyproject.toml", optional_dependencies=["dev"]
ROOT_PATH / "pyproject.toml",
optional_dependencies=["dev"],
force_build=REBUILD_IMAGE,
)
.pip_install("transformers==4.44.2")
.pip_install("transformers==4.44.2", force_build=REBUILD_IMAGE)
)

app = modal.App("liger_tests", image=image)
Expand Down