bitwarden-estensione-browser/.github/workflows/build.yml

70 lines
1.5 KiB
YAML
Raw Normal View History

---
2020-07-23 23:02:59 +02:00
name: Build
on: push
jobs:
cloc:
name: CLOC
runs-on: ubuntu-20.04
2020-07-23 23:02:59 +02:00
steps:
- name: Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
2020-07-23 23:02:59 +02:00
- name: Set up cloc
run: |
sudo apt-get update
sudo apt-get -y install cloc
- name: Print lines of code
run: cloc --include-lang TypeScript,JavaScript,HTML,Sass,CSS --vcs git
build:
name: Build jslib
2020-07-23 23:13:57 +02:00
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019, macos-10.15, ubuntu-20.04]
2020-07-23 23:02:59 +02:00
steps:
- name: Set up Node
uses: actions/setup-node@46071b5c7a2e0c34e49c3cb8a0e792e86e18d5ea
2020-07-23 23:02:59 +02:00
with:
node-version: '14'
2020-07-23 23:02:59 +02:00
- name: Update NPM
run: |
npm install -g npm@7
npm install -g node-gyp
node-gyp install $(node -v)
2020-07-23 23:02:59 +02:00
- name: Print environment
run: |
node --version
npm --version
- name: Checkout repo
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f
2020-07-23 23:02:59 +02:00
- name: Install Node dependencies
run: npm install
- name: Run linter
run: npm run lint
- name: Build
run: npm run build
- name: Run tests
2020-07-24 15:49:59 +02:00
if: runner.os != 'Linux'
2020-07-23 23:02:59 +02:00
run: npm run test
2020-07-23 23:13:57 +02:00
- name: Upload test coverage artifact
2020-07-24 15:49:59 +02:00
if: runner.os != 'Linux'
uses: actions/upload-artifact@ee69f02b3dfdecd58bb31b4d133da38ba6fe3700
2020-07-23 23:02:59 +02:00
with:
name: test-coverage
path: coverage/