mirror of https://github.com/Chocobozzz/PeerTube
Test bundlewatch
parent
c7a53f6121
commit
d632a14729
|
@ -0,0 +1,40 @@
|
||||||
|
name: "Bundlewatch Github Action"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
pull_request:
|
||||||
|
types: [synchronize, opened]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
test:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
- name: Use Node.js
|
||||||
|
uses: actions/setup-node@v1
|
||||||
|
with:
|
||||||
|
node-version: '12.x'
|
||||||
|
|
||||||
|
- name: Cache Node.js modules
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: |
|
||||||
|
**/node_modules
|
||||||
|
~/fixtures
|
||||||
|
key: ${{ runner.OS }}-node-${{ hashFiles('**/yarn.lock') }}
|
||||||
|
restore-keys: |
|
||||||
|
${{ runner.OS }}-node-
|
||||||
|
${{ runner.OS }}-
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --frozen-lockfile
|
||||||
|
|
||||||
|
- uses: jackyef/bundlewatch-gh-action@master
|
||||||
|
with:
|
||||||
|
build-script: npm run build -- --analyze-bundle
|
||||||
|
bundlewatch-github-token: ${{ secrets.BUNDLEWATCH_GITHUB_TOKEN }}
|
|
@ -218,5 +218,13 @@
|
||||||
"sasslintConfig": "client/.sass-lint.yml",
|
"sasslintConfig": "client/.sass-lint.yml",
|
||||||
"_moduleAliases": {
|
"_moduleAliases": {
|
||||||
"@server": "dist/server"
|
"@server": "dist/server"
|
||||||
|
},
|
||||||
|
"bundlewatch" : {
|
||||||
|
"files": [
|
||||||
|
{
|
||||||
|
"path": "client/dist/en-US/*-es2015.js",
|
||||||
|
"maxSize": "1mb"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,15 +30,21 @@ rm -rf ./dist ./compiled
|
||||||
|
|
||||||
pre_build_hook
|
pre_build_hook
|
||||||
|
|
||||||
|
additionalParams=""
|
||||||
|
if [ ! -z ${1+x} ] && [ "$1" == "--analyze-bundle" ]; then
|
||||||
|
additionalParams="--namedChunks=true --outputHashing=none"
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
defaultLanguage="en-US"
|
defaultLanguage="en-US"
|
||||||
npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json
|
npm run ng build -- --output-path "dist/$defaultLanguage/" --deploy-url "/client/$defaultLanguage/" --prod --stats-json $additionalParams
|
||||||
mv "./dist/$defaultLanguage/assets" "./dist"
|
mv "./dist/$defaultLanguage/assets" "./dist"
|
||||||
mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
|
mv "./dist/$defaultLanguage/manifest.webmanifest" "./dist/manifest.webmanifest"
|
||||||
|
|
||||||
post_build_hook
|
post_build_hook
|
||||||
|
|
||||||
# Don't build other languages if --light arg is provided
|
# Don't build other languages if --light arg is provided
|
||||||
if [ -z ${1+x} ] || [ "$1" != "--light" ]; then
|
if [ -z ${1+x} ] || ([ "$1" != "--light" ] && [ "$1" != "--analyze-bundle" ]); then
|
||||||
if [ ! -z ${1+x} ] && [ "$1" == "--light-hu" ]; then
|
if [ ! -z ${1+x} ] && [ "$1" == "--light-hu" ]; then
|
||||||
languages=(["hu"]="hu-HU")
|
languages=(["hu"]="hu-HU")
|
||||||
elif [ ! -z ${1+x} ] && [ "$1" == "--light-ar" ]; then
|
elif [ ! -z ${1+x} ] && [ "$1" == "--light-ar" ]; then
|
||||||
|
|
Loading…
Reference in New Issue