96 строки
2.8 KiB
YAML
96 строки
2.8 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:
|
|
|
|
jobs:
|
|
check-lint:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- 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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- name: ci/setup
|
|
uses: ./.github/actions/webapp-setup
|
|
- name: ci/test
|
|
env:
|
|
NODE_OPTIONS: --max_old_space_size=5120
|
|
run: |
|
|
npm run test-ci
|
|
|
|
build:
|
|
runs-on: ubuntu-22.04
|
|
defaults:
|
|
run:
|
|
working-directory: webapp
|
|
steps:
|
|
- name: ci/checkout-repo
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
|
- 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
|