forked from Josverl/micropython-stubs
-
Notifications
You must be signed in to change notification settings - Fork 0
88 lines (76 loc) · 2.8 KB
/
get-doc-stubs.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
########################################################################################################################################
# This will attempt to retrieve and generate stubs from MicroPython documentation
########################################################################################################################################
# Check out repos in this structure
# micropython-stubs
# +-- stubs
# +-- repos
# +-- micropython
# -- micropython-lib
# repro structure needed to allow automatic PR creation to work
########################################################################################################################################
name: get-doc-stubs
on:
workflow_dispatch:
schedule:
- cron: "0 22 * * *" # Run every day at 22:00
push:
# branches:
# - main
paths:
- .github/workflows/get-doc-stubs.yml
env:
PIP_DISABLE_PIP_VERSION_CHECK: 1
jobs:
########################################################################################################################################
list-versions-doc:
# 'Get a matrix for the latest versions of micropython'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1
- uses: ./.github/actions/get-mpversions
id: dynamic
outputs:
versions: ${{ steps.dynamic.outputs.versions }}
########################################################################################################################################
get-micropython-doc-stubs:
# The type of runner that the job will run on
runs-on: ubuntu-latest
continue-on-error: true
needs: list-versions-doc
strategy:
matrix: ${{ fromJSON(needs.list-versions-doc.outputs.versions) }}
max-parallel: 1
# Most scripts will be run from the stubber, set that as default
defaults:
run:
shell: bash
steps:
- name: Checkout stubs repo
uses: actions/checkout@v4
# make Python work
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.9
cache: "pip"
- name: Install Python dependencies (stubber)
run: |
pip install -U -r requirements.txt
# micropython as a sub-module
- name: "clone and checkout micropython ${{ matrix.version }}"
run: |
stubber clone
stubber switch ${{ matrix.version }}
######################################
# This is where the actual work starts
######################################
- name: Generate document stubs for ${{ matrix.version }}
run: |
stubber get-docstubs
- name: commit
uses: ./.github/actions/commit
with:
message: "Update docstubs stubs for ${{ matrix.version }}"