forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
60 lines (55 loc) · 1.95 KB
/
performance-lighthouse.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
name: Performance - Lighthouse
on:
pull_request:
types: [opened, synchronize, reopened, labeled, unlabeled]
# Allows workflow to be called from other workflows
workflow_call:
inputs:
ref:
required: true
type: string
externalCall:
description: "To distinguish workflow_call from regular push"
type: boolean
required: false
default: false
# Avoid duplicate workflows on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-performance-lighthouse
cancel-in-progress: true
jobs:
performance-lighthouse:
# Only run this job if the PR has the label 'perf:lighthouse' or if it's been called by another workflow
# See https://github.com/actions/runner/discussions/1884 for discussion on why `externalCall` is used
if: contains(github.event.pull_request.labels.*.name, 'perf:lighthouse') || inputs.externalCall
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Set Python version vars
uses: ./.github/actions/build_info
- name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
uses: actions/setup-python@v5
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make frontend
run: make frontend
- name: Run Performance Lighthouse
run: make performance-lighthouse
- name: Set MY_DATE_TIME env var
run: echo "MY_DATE_TIME=$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: performance_lighthouse_${{ env.MY_DATE_TIME }}
path: frontend/app/performance/lighthouse/reports