forked from streamlit/streamlit
-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (99 loc) · 3.14 KB
/
js-tests.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
100
101
102
103
104
105
106
107
108
name: Javascript
on:
push:
branches:
- "develop"
- "feature/**"
pull_request:
types: [opened, synchronize, reopened]
# Allows workflow to be called from other workflows
workflow_call:
inputs:
ref:
required: true
type: string
# Avoid duplicate workflows on same branch
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-javascript
cancel-in-progress: true
jobs:
js_test:
runs-on: ubuntu-latest
defaults:
run:
shell: bash --login -eo pipefail {0}
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
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@v4
with:
python-version: "${{ env.PYTHON_MAX_VERSION }}"
- name: Setup virtual env
uses: ./.github/actions/make_init
- name: Run make develop
run: make develop
- name: Run make protobuf
run: make protobuf
- name: Run make frontend-lib
run: make frontend-lib
- name: Audit frontend licenses
run: ./scripts/audit_frontend_licenses.py
- name: Run linters
run: |
# Run eslint as a standalone command to generate the test report.
# We need to --hook-stage manual to trigger Typecheck too
PRE_COMMIT_NO_CONCURRENCY=true SKIP=eslint pre-commit run --hook-stage manual --show-diff-on-failure --color=always --all-files
# Run eslint using Makefile omitting the pre-commit
make jslint
- name: Validate NOTICES
run: |
# Run `make notices`. If it results in changes, warn the user and fail.
make notices
git_status=$(git status --porcelain -- NOTICES)
if [[ -n $git_status ]]; then
echo "::error::The NOTICES file is out of date! Please run \`make notices\` and commit the result."
echo "::group::git diff NOTICES"
git diff NOTICES
echo "::endgroup::"
exit 1
else
echo "NOTICES is up to date."
fi
- name: Run frontend tests
run: make jstest
components_lib_tests:
runs-on: ubuntu-latest
defaults:
run:
shell: bash --login -eo pipefail {0}
steps:
- name: Checkout Streamlit code
uses: actions/checkout@v3
with:
ref: ${{ inputs.ref }}
persist-credentials: false
submodules: "recursive"
fetch-depth: 2
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "20.x"
cache: "yarn"
cache-dependency-path: "component-lib/yarn.lock"
- name: Install node dependencies
working-directory: component-lib
run: yarn install
- name: Run frontend tests
working-directory: component-lib
run: yarn test
- name: Build package
working-directory: component-lib
run: yarn build