Skip to content

Commit

Permalink
👷 Refactor CI (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
falexwolf authored Aug 3, 2024
1 parent 27a4c80 commit 3f81454
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 91 deletions.
52 changes: 20 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ env:

jobs:
test:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
strategy:
Expand All @@ -22,59 +22,47 @@ jobs:
timeout-minutes: 25

steps:
- name: Checkout main
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- name: Checkout lndocs
- uses: actions/checkout@v4
- name: checkout lndocs
uses: actions/checkout@v4
with:
repository: laminlabs/lndocs
ssh-key: ${{ secrets.READ_LNDOCS }}
path: lndocs
ref: main
- name: Setup Python
uses: actions/setup-python@v5
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache pre-commit
uses: actions/cache@v3
- uses: actions/cache@v3
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ runner.os }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Install Python dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system -U laminci
python -m uv pip install --system rich
python -m uv pip install --system ipywidgets
- name: Configure AWS
uses: aws-actions/configure-aws-credentials@v1
- run: pip install "laminci@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
- run: |
uv pip install --system rich
uv pip install --system ipywidgets
- 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: eu-central-1
- run: nox -s lint
if: matrix.python-version == '3.10' && matrix.group == 'bionty-unit'
- run: nox -s "build(group='${{ matrix.group }}')"
- name: upload coverage
uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v2
with:
name: coverage--${{ matrix.group }}
path: .coverage
- uses: cloudflare/pages-action@v1
- uses: nwtgck/actions-netlify@v1.2
if: ${{ matrix.python-version == '3.10' && matrix.group == 'bionty-docs' }}
id: cloudflare
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: 472bdad691b4483dea759eadb37110bd
projectName: bionty-base
directory: "_build/html"
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: "3"
publish-dir: "_build/html"
production-deploy: ${{ github.event_name == 'push' }}
github-token: ${{ secrets.GITHUB_TOKEN }}
enable-commit-comment: false
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

coverage:
needs: test
Expand All @@ -85,7 +73,7 @@ jobs:
with:
python-version: "3.10"
- run: |
python -m pip install -U pip uv
pip install -U pip uv
uv pip install --system coverage[toml]
uv pip install --system --no-deps .
- uses: actions/download-artifact@v2
Expand Down
23 changes: 23 additions & 0 deletions .github/workflows/doc-changes.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: doc-changes

on:
pull_request_target:
branches:
- main
types:
- closed

jobs:
latest-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install "laminci[doc-changes]@git+https://x-access-token:${{ secrets.LAMIN_BUILD_DOCS }}@github.com/laminlabs/laminci"
- run: laminci doc-changes
env:
repo_token: ${{ secrets.GITHUB_TOKEN }}
docs_token: ${{ secrets.LAMIN_BUILD_DOCS }}
changelog_file: lamin-docs/docs/changelog/soon/bionty.md
2 changes: 0 additions & 2 deletions .github/workflows/latest-changes.jinja2

This file was deleted.

25 changes: 0 additions & 25 deletions .github/workflows/latest-changes.yml

This file was deleted.

31 changes: 0 additions & 31 deletions docs/changelog.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@
guide
reference
changelog
```

0 comments on commit 3f81454

Please sign in to comment.