Skip to content

Commit

Permalink
Merge pull request #1 from laminlabs/ci
Browse files Browse the repository at this point in the history
💚 Fix CI
  • Loading branch information
falexwolf authored Jan 2, 2025
2 parents d8a1ac6 + 1f8ab35 commit 434e868
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 22 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
- os: ubuntu-latest
python: "3.12"
pip-flags: "--pre"
group: ["unit", "docs"]
timeout-minutes: 15

steps:
Expand All @@ -45,35 +44,33 @@ jobs:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}
- run: pip install git+https://github.com/laminlabs/laminci
# - run: sudo apt-get -y install graphviz

- uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: Run lint
if: matrix.group == 'unit'
run: nox -s lint
- run: nox -s lint

- name: Run build
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
run: nox -s "build(group='${{ matrix.group }}')"
- run: nox -s test

- uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

- run: nox -s docs
if: ${{ github.event_name == 'push' || (github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository) }}
- uses: cloudflare/wrangler-action@v3
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
if: ${{ github.event_name == 'push' || (github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository) }}
id: cloudflare
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 472bdad691b4483dea759eadb37110bd
command: pages deploy "_build/html" --project-name=PROJECTNAME
command: pages deploy "_build/html" --project-name=moscan
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
- uses: edumserrano/find-create-or-update-comment@v2
if: ${{ !(matrix.group == 'docs' && github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository) }}
if: ${{ github.event_name == 'push' || (github.event.pull_request && github.event.pull_request.head.repo.full_name == github.repository) }}
with:
issue-number: ${{ github.event.pull_request.number }}
body-includes: "Deployment URL"
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/doc-changes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ jobs:
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
changelog_file: PATH_TO_CHANGELOG_FILE
changelog_file: lamin-docs/docs/changelog/soon/moscan.md
Empty file removed moscan/migrations/__init__.py
Empty file.
Empty file removed moscan/models.py
Empty file.
18 changes: 9 additions & 9 deletions noxfile.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import nox
from laminci.nox import build_docs, login_testuser1, run_pre_commit, run_pytest
from laminci.nox import build_docs, run, run_pre_commit, run_pytest

# we'd like to aggregate coverage information across sessions
# and for this the code needs to be located in the same
Expand All @@ -14,12 +14,12 @@ def lint(session: nox.Session) -> None:


@nox.session()
@nox.parametrize("group", ["unit", "docs"])
def build(session, group):
session.run(*"uv pip install --system -e .[dev]".split())
login_testuser1(session)
def test(session):
run(session, "uv pip install --system -e .[dev]")
run_pytest(session)

if group == "unit":
run_pytest(session)
elif group == "docs":
build_docs(session, strict=True)

@nox.session()
def docs(session):
run(session, "lamin init --storage ./testdb")
build_docs(session, strict=True)
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ authors = [{name = "Lamin Labs", email = "[email protected]"}]
readme = "README.md"
dynamic = ["version", "description"]
dependencies = [
"lamindb",
]

[project.urls]
Home = "https://github.com/laminlabs/moscan"

[project.optional-dependencies]
dev = [
"lamindb",
"pre-commit",
"nox",
"pytest>=6.0",
Expand Down

0 comments on commit 434e868

Please sign in to comment.