Merge pull request #5 from METR/sync-data #12
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
name: Continuous Integration | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
jobs: | |
format-and-lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry==1.8.3 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: poetry | |
- name: poetry install | |
run: poetry install | |
- name: Ruff lint | |
run: poetry run ruff check . --output-format=github | |
- name: Ruff format | |
run: poetry run ruff format . --check | |
- name: Run typecheck | |
run: poetry run pyright . | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry==1.8.3 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: poetry | |
- name: poetry install | |
run: |- | |
poetry install | |
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH | |
- name: Configure DVC | |
run: |- | |
dvc remote modify --local s3 access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
dvc remote modify --local s3 secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
- name: Run tests | |
run: | | |
poetry run pytest -vv tests/ --capture=no | |
check-pipelines: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Poetry | |
run: pipx install poetry==1.8.3 | |
- name: Install python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.11" | |
cache: poetry | |
- name: poetry install | |
run: |- | |
poetry install | |
echo "$(poetry env info --path)/bin" >> $GITHUB_PATH | |
- name: Configure DVC | |
run: |- | |
dvc remote modify --local s3 access_key_id "${{ secrets.AWS_ACCESS_KEY_ID }}" | |
dvc remote modify --local s3 secret_access_key "${{ secrets.AWS_SECRET_ACCESS_KEY }}" | |
- name: Run check pipelines | |
run: |- | |
set -o pipefail | |
echo "Checking pipeline" | |
dvc repro --dry --allow-missing | |
dvc data status --not-in-remote --json | jq -e 'has("not_in_remote") | not' |