mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-19 11:15:21 +01:00
133 lines
3.4 KiB
YAML
133 lines
3.4 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches-ignore:
|
|
- 'l10n_master'
|
|
workflow_dispatch:
|
|
inputs:
|
|
|
|
|
|
jobs:
|
|
cloc:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up cloc
|
|
run: |
|
|
sudo apt update
|
|
sudo apt -y install cloc
|
|
- name: Print lines of code
|
|
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
|
|
|
|
|
|
setup:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
repo_url: ${{ steps.gen_vars.outputs.repo_url }}
|
|
adj_build_number: ${{ steps.gen_vars.outputs.adj_build_number }}
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Get Package Version
|
|
id: gen_vars
|
|
run: |
|
|
repo_url=https://github.com/$GITHUB_REPOSITORY.git
|
|
adj_build_num=${GITHUB_SHA:0:7}
|
|
|
|
echo "::set-output name=repo_url::$repo_url"
|
|
echo "::set-output name=adj_build_number::$adj_build_num"
|
|
|
|
locales-test:
|
|
runs-on: ubuntu-latest
|
|
needs: setup
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Testing locales - extName length
|
|
run: |
|
|
found_error=false
|
|
|
|
echo "Locales Test"
|
|
echo "============"
|
|
echo "extName string must be 40 characters or less"
|
|
echo
|
|
for locale in $(ls src/_locales/); do
|
|
string_length=$(jq '.extName.message | length' src/_locales/$locale/messages.json)
|
|
if [[ $string_length -gt 40 ]]; then
|
|
echo "$locale: $string_length"
|
|
found_error=true
|
|
fi
|
|
done
|
|
|
|
if $found_error; then
|
|
echo
|
|
echo "Please fix 'extName' for the locales listed above."
|
|
exit 1
|
|
else
|
|
echo "Test passed!"
|
|
fi
|
|
|
|
build:
|
|
runs-on: windows-latest
|
|
needs: [ setup, locales-test ]
|
|
env:
|
|
REPO_URL: ${{ needs.setup.outputs.repo_url }}
|
|
BUILD_NUMBER: ${{ needs.setup.outputs.adj_build_number }}
|
|
steps:
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v2
|
|
|
|
- name: Set up Node
|
|
uses: actions/setup-node@v1
|
|
with:
|
|
node-version: '14.x'
|
|
|
|
- name: Print environment
|
|
run: |
|
|
node --version
|
|
npm --version
|
|
|
|
- name: npm setup & test
|
|
run: |
|
|
npm install
|
|
npm run dist
|
|
npm run test
|
|
|
|
- name: gulp
|
|
run: gulp ci
|
|
|
|
- name: Upload opera artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: dist-opera-${{ env.BUILD_NUMBER }}.zip
|
|
path: dist/dist-opera-${{ env.BUILD_NUMBER }}.zip
|
|
|
|
- name: Upload chrome artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: dist-chrome-${{ env.BUILD_NUMBER }}.zip
|
|
path: dist/dist-chrome-${{ env.BUILD_NUMBER }}.zip
|
|
|
|
- name: Upload firefox artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: dist-firefox-${{ env.BUILD_NUMBER }}.zip
|
|
path: dist/dist-firefox-${{ env.BUILD_NUMBER }}.zip
|
|
|
|
- name: Upload edge artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: dist-edge-${{ env.BUILD_NUMBER }}.zip
|
|
path: dist/dist-edge-${{ env.BUILD_NUMBER }}.zip
|
|
|
|
- name: Upload coverage artifact
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: coverage-${{ env.BUILD_NUMBER }}.zip
|
|
path: coverage/coverage-${{ env.BUILD_NUMBER }}.zip
|