Skip to content

Commit

Permalink
ci: replace appveyor with gh actions (#177)
Browse files Browse the repository at this point in the history
* ci: replace appveyor with gh actions

* fix indentation

* add os checks

* update test
  • Loading branch information
thijstriemstra authored Feb 13, 2024
1 parent 5711214 commit 381bf8e
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 72 deletions.
84 changes: 47 additions & 37 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,53 @@ on:

jobs:
build:

runs-on: ubuntu-latest

runs-on: ${{ matrix.os }}
strategy:
matrix:
node-version: [20]

os:
- ubuntu-latest
- windows-latest
node-version:
- 20
architecture:
- x64
name: ${{ matrix.os }} - Node ${{ matrix.node-version }} (${{ matrix.architecture }})
steps:
- uses: actions/checkout@v4
- name: Update system
run: sudo apt-get update
- name: Install system dependencies
run: sudo apt-get install -y ubuntu-restricted-addons chromium-codecs-ffmpeg-extra gstreamer1.0-libav gstreamer1.0-plugins-ugly gstreamer1.0-vaapi
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Cache Node.js modules
uses: actions/cache@v4
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Install Node.js modules
run: npm install
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Coveralls
if: always()
uses: coverallsapp/github-action@v2
with:
path-to-lcov: ${{ github.workspace }}/coverage/lcov/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Documentation
run: npm run docs
- uses: actions/checkout@v4
- name: Update system
if: runner.os == 'Linux'
run: sudo apt-get update
- name: Install system dependencies
if: runner.os == 'Linux'
run: sudo apt-get install -y ubuntu-restricted-addons chromium-codecs-ffmpeg-extra gstreamer1.0-libav gstreamer1.0-plugins-ugly gstreamer1.0-vaapi
- name: Using Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
architecture: ${{ matrix.architecture }}
- name: Get npm cache directory
id: npm-cache-dir
shell: bash
run: echo "dir=$(npm config get cache)" >> ${GITHUB_OUTPUT}
- name: Cache npm modules
uses: actions/cache@v4
id: npm-cache # use this to check for `cache-hit` ==> if: steps.npm-cache.outputs.cache-hit != 'true'
with:
path: ${{ steps.npm-cache-dir.outputs.dir }}
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Node.js modules
run: npm install
- name: Build
run: npm run build
- name: Test
run: npm run test
- name: Coveralls
if: runner.os == 'Linux'
uses: coverallsapp/github-action@v2
with:
path-to-lcov: ${{ github.workspace }}/coverage/lcov/lcov.info
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Documentation
run: npm run docs
33 changes: 0 additions & 33 deletions appveyor.yml

This file was deleted.

4 changes: 2 additions & 2 deletions test/videojs.wavesurfer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ describe('Wavesurfer', () => {
player.wavesurfer().setCurrentTime(0.123);

// only updates player visually
expect(player.controlBar.currentTimeDisplay.formattedTime_).toEqual('00:00:123');
expect(player.controlBar.currentTimeDisplay.formattedTime_).toStartWith('00:00:');

// invalid values result in 0
player.wavesurfer().setCurrentTime('foo', 'bar');
Expand Down Expand Up @@ -173,7 +173,7 @@ describe('Wavesurfer', () => {
player.wavesurfer().setDuration(0.1);

// only updates player visually
expect(player.controlBar.durationDisplay.formattedTime_).toEqual('00:00:100');
expect(player.controlBar.durationDisplay.formattedTime_).toStartWith('00:00:');

// invalid values result in 0
player.wavesurfer().setDuration('foo');
Expand Down

0 comments on commit 381bf8e

Please sign in to comment.