Skip to content

Commit

Permalink
Add GH actions workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
larixer committed Oct 22, 2020
1 parent 0fb1623 commit 1f44784
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 251 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Build and test webpack-virtual-modules

on:
push:
branches: [ master ]
pull_request:

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
webpack-version: [3, 4, 5]

steps:
- uses: actions/checkout@v2

- uses: actions/cache@v2
with:
path: |
./.yarn/releases
./.yarn/cache
key: ${{ runner.os }}-install-${{ hashFiles('yarn.lock') }}-v4

- name: 'Use Node.js 12.x'
uses: actions/setup-node@master
with:
node-version: 12.x

- name: Install Webpack ${{ matrix.webpack-version }}
run: |
yarn config set enableMirror false
yarn config set enableGlobalCache false
yarn add webpack@${{ matrix.webpack-version }}
- name: Run tests
run: yarn test
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
nodeLinker: node-modules
compressionLevel: 0
enableGlobalCache: true
yarnPath: .pinyarn
yarnPath: .pinyarn.js
nmHoistingLimits: dependencies
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
"watch": "tsc -p tsconfig.build.json -w",
"tests": "jest",
"tests:watch": "jest --watch",
"test": "yarn lint && yarn coverage && yarn tests",
"coverage": "NODE_ENV=coverage nyc --check-coverage --lines 85 --branches 60 yarn tests",
"test": "yarn lint && yarn tests",
"lint": "eslint --fix src/**/*.ts",
"prepack": "yarn clean && yarn build"
},
Expand Down Expand Up @@ -51,7 +50,6 @@
"jest": "^26.6.0",
"lint-staged": "^10.4.2",
"memory-fs": "^0.5.0",
"nyc": "^15.1.0",
"prettier": "^2.1.2",
"tmp": "^0.2.1",
"typescript": "^4.0.3",
Expand Down
1 change: 0 additions & 1 deletion src/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import MemoryFileSystem from 'memory-fs';
import webpack from 'webpack';
import path from 'path';
import Plugin from '../index';
import { resolve } from 'dns';

describe('webpack-virtual-modules', () => {
it('should fail if not applied as plugin', () => {
Expand Down
Loading

0 comments on commit 1f44784

Please sign in to comment.