Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing type error & Adding caching to the testing action #4

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 45 additions & 28 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,48 @@
name: "Test Extension"
name: 'Test Extension'
on: [push, pull_request]

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
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'
- run: npm install
- name: Install APT libraries
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y 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
- run: xvfb-run -a npm test
if: runner.os == 'Linux'
- run: npm test
if: runner.os != 'Linux'

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 install
- 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 }}
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
node_modules
package-lock.json
.vscode-test
out
dist
203 changes: 203 additions & 0 deletions example/app/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading