This repository has been archived by the owner on Aug 7, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
99 lines (93 loc) · 2.94 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
name: build
on:
push:
branches: [main]
pull_request:
branches: [main, staging]
workflow_dispatch:
env:
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
jobs:
test:
runs-on: ubuntu-22.04
env:
GITHUB_EVENT_NAME: ${{ github.event_name }}
strategy:
fail-fast: false
matrix:
python-version: ["3.11"]
group: ["bionty-unit", "bionty-docs"]
timeout-minutes: 25
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
submodules: recursive
fetch-depth: 0
- 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
with:
python-version: ${{ matrix.python-version }}
- name: Cache pre-commit
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
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.11' && matrix.group == 'bionty-unit'
- run: nox -s "build(group='${{ matrix.group }}')"
- name: upload coverage
uses: actions/upload-artifact@v2
with:
name: coverage--${{ matrix.group }}
path: .coverage
- uses: cloudflare/pages-action@v1
if: ${{ matrix.python-version == '3.11' && 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"
coverage:
needs: test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: |
python -m pip install -U pip uv
uv pip install --system coverage[toml]
uv pip install --system --no-deps .
- uses: actions/download-artifact@v2
- name: run coverage
run: |
coverage combine coverage--*/.coverage*
coverage report --fail-under=0
coverage xml
- uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}