Skip to content

Commit

Permalink
Merge pull request #4 from MaxTCodes/fixing-type-errors-and-caching-a…
Browse files Browse the repository at this point in the history
…pt-packages

Fixing type error & Adding caching to the testing action
  • Loading branch information
jeremytenjo authored Feb 4, 2025
2 parents 0733b1f + 670be4c commit 64b55c9
Show file tree
Hide file tree
Showing 6 changed files with 5,597 additions and 32 deletions.
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

0 comments on commit 64b55c9

Please sign in to comment.