Switching from npm install to npm ci #19
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 'Test Extension' | |
on: [push, pull_request] | |
jobs: | |
build: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macOS-latest] | |
include: | |
- os: ubuntu-latest | |
test_command: xvfb-run -a npm test | |
npm_cache_dir: ~/.npm | |
- os: windows-latest | |
test_command: npm test | |
npm_cache_dir: ~\AppData\Local\npm-cache | |
- os: macOS-latest | |
test_command: npm test | |
npm_cache_dir: ~/.npm | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Install Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '18.17.1' | |
- name: Cache npm packages | |
id: cache-npm | |
uses: actions/cache@v3 | |
env: | |
cache-name: npm-cache | |
with: | |
path: ${{ matrix.npm_cache_dir }} | |
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} | |
restore-keys: | | |
${{ runner.os }}-${{ env.cache-name }}- | |
- name: Install npm packages | |
run: npm ci | |
- name: Install & Cache apt packages | |
if: runner.os == 'Linux' | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: build-essential xvfb clang libdbus-1-dev libgtk-3-dev libnotify-dev libasound2-dev libcap-dev libcups2-dev libxtst-dev libxss1 libnss3-dev gcc-multilib g++-multilib curl gperf bison python3-dbusmock openjdk-8-jre | |
version: 1.0 | |
- name: Run tests | |
run: ${{ matrix.test_command }} |