streamlit

Форк
0
/
js-tests.yml 
107 строк · 3.1 Кб
1
name: Javascript
2

3
on:
4
  push:
5
    branches:
6
      - "develop"
7
  pull_request:
8
    types: [opened, synchronize, reopened]
9
  # Allows workflow to be called from other workflows
10
  workflow_call:
11
    inputs:
12
      ref:
13
        required: true
14
        type: string
15

16
# Avoid duplicate workflows on same branch
17
concurrency:
18
  group: ${{ github.workflow }}-${{ github.ref }}-javascript
19
  cancel-in-progress: true
20

21
jobs:
22
  js_test:
23
    runs-on: ubuntu-latest
24

25
    defaults:
26
      run:
27
        shell: bash --login -eo pipefail {0}
28

29
    steps:
30
      - name: Checkout Streamlit code
31
        uses: actions/checkout@v4
32
        with:
33
          ref: ${{ inputs.ref }}
34
          persist-credentials: false
35
          submodules: "recursive"
36
          fetch-depth: 2
37
      - name: Set Python version vars
38
        uses: ./.github/actions/build_info
39
      - name: Set up Python ${{ env.PYTHON_MAX_VERSION }}
40
        uses: actions/setup-python@v5
41
        with:
42
          python-version: "${{ env.PYTHON_MAX_VERSION }}"
43
      - name: Setup virtual env
44
        uses: ./.github/actions/make_init
45
      - name: Run make develop
46
        run: make develop
47
      - name: Run make protobuf
48
        run: make protobuf
49
      - name: Run make frontend-lib
50
        run: make frontend-lib
51
      - name: Audit frontend licenses
52
        run: ./scripts/audit_frontend_licenses.py
53
      - name: Run linters
54
        run: |
55
          # Run eslint as a standalone command to generate the test report.
56
          # We need to --hook-stage manual to trigger Typecheck too
57
          PRE_COMMIT_NO_CONCURRENCY=true SKIP=eslint pre-commit run --hook-stage manual --show-diff-on-failure --color=always --all-files
58
          # Run eslint using Makefile omitting the pre-commit
59
          make jslint
60
      - name: Validate NOTICES
61
        run: |
62
          # Run `make notices`. If it results in changes, warn the user and fail.
63
          make notices
64

65
          git_status=$(git status --porcelain -- NOTICES)
66
          if [[ -n $git_status ]]; then
67
            echo "::error::The NOTICES file is out of date! Please run \`make notices\` and commit the result."
68
            echo "::group::git diff NOTICES"
69
            git diff NOTICES
70
            echo "::endgroup::"
71
            exit 1
72
          else
73
            echo "NOTICES is up to date."
74
          fi
75
      - name: Run frontend tests
76
        run: make jstest
77

78
  components_lib_tests:
79
    runs-on: ubuntu-latest
80

81
    defaults:
82
      run:
83
        shell: bash --login -eo pipefail {0}
84

85
    steps:
86
      - name: Checkout Streamlit code
87
        uses: actions/checkout@v4
88
        with:
89
          ref: ${{ inputs.ref }}
90
          persist-credentials: false
91
          submodules: "recursive"
92
          fetch-depth: 2
93
      - name: Setup Node
94
        uses: actions/setup-node@v4
95
        with:
96
          node-version: "20.x"
97
          cache: "yarn"
98
          cache-dependency-path: "component-lib/yarn.lock"
99
      - name: Install node dependencies
100
        working-directory: component-lib
101
        run: yarn install
102
      - name: Run frontend tests
103
        working-directory: component-lib
104
        run: yarn test
105
      - name: Build package
106
        working-directory: component-lib
107
        run: yarn build
108

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.