* Skip code coverage generation on cherry-picks * Skip upload step for webapp coverage for cherry-picks
107 строки
3.2 KiB
YAML
107 строки
3.2 KiB
YAML
# Base CI template which is called from webapp-ci-pr.yml
|
|
# and webapp-ci-master.yml
|
|
|
|
name: Web App CI Template
|
|
on:
|
|
workflow_call:
|
|
secrets:
|
|
CODECOV_TOKEN:
|
|
required: true
|
|
|
|
jobs:
|
|
check-lint:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/lint
|
|
run: |
|
|
npm run check
|
|
|
|
check-i18n:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/lint
|
|
working-directory: webapp/channels
|
|
run: |
|
|
cp src/i18n/en.json /tmp/en.json
|
|
mkdir -p /tmp/fake-mobile-dir/assets/base/i18n/
|
|
echo '{}' > /tmp/fake-mobile-dir/assets/base/i18n/en.json
|
|
npm run mmjstool -- i18n extract-webapp --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir
|
|
diff /tmp/en.json src/i18n/en.json
|
|
# Address weblate behavior which does not remove whole translation item when translation string is set to empty
|
|
npm run mmjstool -- i18n clean-empty --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir --check
|
|
npm run mmjstool -- i18n check-empty-src --webapp-dir ./src --mobile-dir /tmp/fake-mobile-dir
|
|
rm -rf tmp
|
|
|
|
check-types:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/lint
|
|
run: |
|
|
npm run check-types
|
|
|
|
test:
|
|
runs-on: ubuntu-22.04
|
|
permissions:
|
|
checks: write
|
|
pull-requests: write
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/test
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=5120
|
|
run: |
|
|
npm run test-ci
|
|
- name: Upload coverage to Codecov
|
|
# Skip coverage upload for cherry-pick PRs into release branches.
|
|
if: ${{ github.event_name != 'pull_request' || !startsWith(github.event.pull_request.base.ref, 'release-') }}
|
|
uses: codecov/codecov-action@v5
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }}
|
|
disable_search: true
|
|
files: ./webapp/channels/coverage/lcov.info
|
|
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/build
|
|
run: |
|
|
npm run build
|
|
|
|
# run-performance-bechmarks:
|
|
# uses: ./.github/workflows/performance-benchmarks.yml
|
|
# needs: build
|