-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: extract current github jobs for reuse
- Loading branch information
1 parent
103f164
commit 4f2d166
Showing
6 changed files
with
217 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
name: CI | ||
|
||
# Scheduled workflows will only run on the default branch. | ||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # runs once a day at midnight in the timezone of your GitHub repository | ||
|
||
jobs: | ||
build: | ||
runs-on: [windows-latest, macos-latest] | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
# your steps go here |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
on: | ||
workflow_call: | ||
jobs: | ||
doctest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry config installer.max-workers 10 | ||
poetry install --no-interaction | ||
- name: install Sphinx | ||
run: sudo apt-get update -y && sudo apt-get install python3-sphinx | ||
- name: run doctest | ||
env: | ||
AA_TOKEN: ${{ secrets.AA_TOKEN }} | ||
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} | ||
CLIENT_URL: "https://api.aleph-alpha.com" | ||
run: ./scripts/doctest.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
on: | ||
workflow_call: | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry config installer.max-workers 10 | ||
poetry install --no-interaction | ||
- name: set PY for pre-commit | ||
run: echo "PY=$(python -VV | sha256sum | cut -d' ' -f1)" >> $GITHUB_ENV | ||
|
||
- uses: actions/cache@v4 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit|${{ env.PY }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
|
||
- name: Run linters | ||
run: | | ||
./scripts/lint.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
on: | ||
workflow_call: | ||
jobs: | ||
run-notebooks: | ||
runs-on: ubuntu-latest | ||
services: | ||
argilla-elastic-search: | ||
image: docker.elastic.co/elasticsearch/elasticsearch:8.5.3 | ||
env: | ||
ES_JAVA_OPTS: "-Xms512m -Xmx512m" | ||
discovery.type: "single-node" | ||
xpack.security.enabled: "false" | ||
argilla: | ||
image: argilla/argilla-server | ||
ports: | ||
- "6900:6900" | ||
env: | ||
ARGILLA_ELASTICSEARCH: "http://argilla-elastic-search:9200" | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
- name: Install and configure Poetry | ||
uses: snok/install-poetry@v1 | ||
with: | ||
virtualenvs-create: true | ||
virtualenvs-in-project: true | ||
installer-parallel: true | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v4 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }} | ||
- name: Install dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: | | ||
poetry config installer.max-workers 10 | ||
poetry install --no-interaction | ||
- name: Configure Poetry for notebooks and run | ||
env: | ||
AA_TOKEN: ${{ secrets.AA_TOKEN }} | ||
HUGGING_FACE_TOKEN: ${{ secrets.HUGGING_FACE_TOKEN }} | ||
ARGILLA_API_URL: "http://localhost:6900/" | ||
ARGILLA_API_KEY: "argilla.apikey" | ||
CLIENT_URL: "https://api.aleph-alpha.com" | ||
run: | | ||
./scripts/notebook_runner.sh |
Oops, something went wrong.