-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from MaxTCodes/fixing-type-errors-and-caching-a…
…pt-packages Fixing type error & Adding caching to the testing action
- Loading branch information
Showing
6 changed files
with
5,597 additions
and
32 deletions.
There are no files selected for viewing
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
node_modules | ||
package-lock.json | ||
.vscode-test | ||
out | ||
dist |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.