-
Notifications
You must be signed in to change notification settings - Fork 8
118 lines (99 loc) · 2.96 KB
/
update.yaml
File metadata and controls
118 lines (99 loc) · 2.96 KB
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Update and publish
on:
schedule:
- cron: '*/5 * * * *'
push:
branches:
- main
workflow_dispatch:
pull_request:
defaults:
run:
shell: bash
concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install Python dependencies
run: pip3 install -U PyGithub west
- name: Setup the manifest data
run: |
mkdir -p west/submanifests
wget --progress=dot https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/main/west.yml -O west/west.yml
wget --progress=dot https://raw.githubusercontent.com/zephyrproject-rtos/zephyr/main/submanifests/optional.yaml -O west/submanifests/optional.yaml
west init -l west
west config manifest.group-filter -- +ci,+optional
- name: Update
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
mkdir cache
# Set to false for testing with cached data.
if true; then
python -u update_zephyr_pr.py 2>&1
bzip2 -c cache/data_dump.json > public/data_dump.json.bz2
else
./download_cache_data
fi
- name: Crunch
run: |
python -u crunch_data.py 2>&1
- name: Upload debugging artifacts (debug)
if: failure() || github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
if-no-files-found: ignore
path:
public/
- name: Setup pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5
- name: Upload pages artifact
if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: public
deploy:
if: github.event_name != 'pull_request'
needs: build
permissions:
pages: write
id-token: write
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v4
screenshot:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
needs: build
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download pages artifact
uses: actions/download-artifact@v5
with:
path: public
- name: Set up Node.js
uses: actions/setup-node@v4
- name: Start a local web server and take a screenshot
run: |
cd public
python -m http.server 8080 &
cd ..
npm install puppeteer
node screenshot.js
- name: Upload screenshots as artifacts
uses: actions/upload-artifact@v4
with:
name: screenshots
path: screenshot-*.png