Merge pull request #983 from ajayyy/test-action

Add testing action
This commit is contained in:
Ajay Ramachandran 2021-10-02 18:00:09 -04:00 committed by GitHub
commit 9ab8e63b1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 2076 additions and 198 deletions

View file

@ -12,7 +12,9 @@ jobs:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
with:
node-version: '16'
- run: npm ci
- name: Copy configuration
run: cp config.json.example config.json

View file

@ -14,7 +14,9 @@ jobs:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- run: npm install
with:
node-version: '16'
- run: npm ci
- name: Copy configuration
run: cp config.json.example config.json

20
.github/workflows/tests.yml vendored Normal file
View file

@ -0,0 +1,20 @@
name: Tests
on: [push, pull_request]
jobs:
build:
name: Run tests
runs-on: ubuntu-latest
steps:
# Initialization
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: '16'
- run: npm ci
- name: Run tests
run: npm run test-without-building

View file

@ -60,6 +60,8 @@ You can read the API docs [here](https://wiki.sponsor.ajay.app/index.php/API_Doc
# Building
You must have Node.js 16 installed.
Rename `config.json.example` to `config.json` and adjust configuration as desired.
There are also other build scripts available. Install `npm`, then run `npm install` in the repository to install dependencies.

2234
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -3,7 +3,15 @@ import * as Chrome from "selenium-webdriver/chrome";
import * as Path from "path";
test("Selenium Chrome test", async () => {
const driver = await setup();
let driver;
try {
driver = await setup();
} catch (e) {
console.warn("A browser is probably not installed, skipping selenium tests");
console.warn(e);
return;
}
try {
await waitForInstall(driver);