Skip to content

Commit 3c2eb99

Browse files
Update build.yml
1 parent ae0180f commit 3c2eb99

File tree

1 file changed

+95
-5
lines changed

1 file changed

+95
-5
lines changed

.github/workflows/build.yml

Lines changed: 95 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,104 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
22
#
33
# SPDX-License-Identifier: MIT
44

55
name: Build CI
66

7-
on: [pull_request, push]
7+
on:
8+
pull_request:
9+
types: [opened, reopened]
10+
push:
811

912
jobs:
10-
test:
13+
build-wheel:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- name: Run Build CI workflow
14-
uses: adafruit/workflows-circuitpython-libs/build@main
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.x"
19+
20+
- uses: actions/checkout@v3
21+
22+
- name: Build wheel
23+
run: pip wheel -w dist --no-deps .
24+
25+
- name: check dist
26+
run: pipx run twine check dist/*
27+
28+
- name: Archive wheel
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: wheel
32+
path: ${{ github.workspace }}/dist/
33+
34+
linters:
35+
runs-on: ubuntu-latest
36+
steps:
37+
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.x"
41+
42+
- uses: actions/checkout@v3
43+
44+
build-bundles:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: Translate Repo Name For Build Tools filename_prefix
48+
id: repo-name
49+
run: |
50+
echo repo-name=$(
51+
echo ${{ github.repository }} |
52+
awk -F '\/' '{ print tolower($2) }' |
53+
tr '_' '-'
54+
) >> $GITHUB_OUTPUT
55+
56+
- uses: actions/checkout@v3
57+
58+
- name: Set up Python 3.x
59+
uses: actions/setup-python@v4
60+
with:
61+
python-version: "3.x"
62+
63+
- name: Checkout tools repo
64+
uses: actions/checkout@v3
65+
with:
66+
repository: adafruit/actions-ci-circuitpython-libs
67+
path: actions-ci
68+
69+
- name: Install deps
70+
run: |
71+
source actions-ci/install.sh
72+
73+
- name: Build assets
74+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
75+
76+
- name: Archive bundles
77+
uses: actions/upload-artifact@v3
78+
with:
79+
name: bundles
80+
path: ${{ github.workspace }}/bundles/
81+
82+
build-docs:
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v3
86+
87+
- name: Set up Python 3.x
88+
uses: actions/setup-python@v4
89+
with:
90+
python-version: "3.x"
91+
92+
- name: Install deps
93+
run: |
94+
pip install -r docs/requirements.txt -r requirements.txt
95+
96+
- name: Build docs
97+
working-directory: docs
98+
run: sphinx-build -E -W -b html . _build/html
99+
100+
- name: Archive docs
101+
uses: actions/upload-artifact@v3
102+
with:
103+
name: docs
104+
path: ${{ github.workspace }}/docs/_build/html

0 commit comments

Comments
 (0)