Skip to content
This repository was archived by the owner on Mar 17, 2021. It is now read-only.

Commit 3846b33

Browse files
authoredApr 24, 2020
ci: migrate on github actions (#372)
1 parent e44eb73 commit 3846b33

8 files changed

+1106
-1275
lines changed
 

‎.github/workflows/nodejs.yml

+95
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
name: file-loader
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- next
8+
pull_request:
9+
branches:
10+
- master
11+
- next
12+
13+
jobs:
14+
lint:
15+
name: Lint - ${{ matrix.os }} - Node v${{ matrix.node-version }}
16+
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
20+
strategy:
21+
matrix:
22+
os: [ubuntu-latest]
23+
node-version: [12.x]
24+
25+
runs-on: ${{ matrix.os }}
26+
27+
steps:
28+
- uses: actions/checkout@v2
29+
with:
30+
fetch-depth: 0
31+
32+
- name: Use Node.js ${{ env.node-version }}
33+
uses: actions/setup-node@v1
34+
with:
35+
node-version: ${{ env.node-version }}
36+
37+
- name: Use latest NPM
38+
run: sudo npm i -g npm
39+
40+
- name: Install dependencies
41+
run: npm ci
42+
43+
- name: Lint
44+
run: npm run lint
45+
46+
- name: Security audit
47+
run: npm run security
48+
49+
- name: Check commit message
50+
uses: wagoid/commitlint-github-action@v1
51+
52+
test:
53+
name: Test - ${{ matrix.os }} - Node v${{ matrix.node-version }}, Webpack ${{ matrix.webpack-version }}
54+
55+
strategy:
56+
matrix:
57+
os: [ubuntu-latest, windows-latest, macos-latest]
58+
node-version: [10.x, 12.x, 14.x]
59+
webpack-version: [latest, next]
60+
61+
runs-on: ${{ matrix.os }}
62+
63+
steps:
64+
- name: Setup Git
65+
if: matrix.os == 'windows-latest'
66+
run: git config --global core.autocrlf input
67+
68+
- uses: actions/checkout@v2
69+
70+
- name: Use Node.js ${{ matrix.node-version }}
71+
uses: actions/setup-node@v1
72+
with:
73+
node-version: ${{ matrix.node-version }}
74+
75+
- name: Use latest NPM on ubuntu/macos
76+
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macos-latest'
77+
run: sudo npm i -g npm
78+
79+
- name: Use latest NPM on windows
80+
if: matrix.os == 'windows-latest'
81+
run: npm i -g npm
82+
83+
- name: Install dependencies
84+
run: npm ci
85+
86+
- name: Install webpack ${{ matrix.webpack-version }}
87+
run: npm i webpack@${{ matrix.webpack-version }}
88+
89+
- name: Run tests for webpack version ${{ matrix.webpack-version }}
90+
run: npm run test:coverage -- --ci
91+
92+
- name: Submit coverage data to codecov
93+
uses: codecov/codecov-action@v1
94+
with:
95+
token: ${{ secrets.CODECOV_TOKEN }}

‎.prettierrc.js

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
module.exports = {
2-
singleQuote: true,
3-
trailingComma: 'es5',
4-
arrowParens: 'always',
5-
};
1+
module.exports = { singleQuote: true };

‎README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -753,8 +753,8 @@ Please take a moment to read our contributing guidelines if you haven't yet done
753753
[node-url]: https://nodejs.org
754754
[deps]: https://david-dm.org/webpack-contrib/file-loader.svg
755755
[deps-url]: https://david-dm.org/webpack-contrib/file-loader
756-
[tests]: https://dev.azure.com/webpack-contrib/file-loader/_apis/build/status/webpack-contrib.file-loader?branchName=master
757-
[tests-url]: https://dev.azure.com/webpack-contrib/file-loader/_build/latest?definitionId=2&branchName=master
756+
[tests]: https://github.com/webpack-contrib/file-loader/workflows/file-loader/badge.svg
757+
[tests-url]: https://github.com/webpack-contrib/file-loader/actions
758758
[cover]: https://codecov.io/gh/webpack-contrib/file-loader/branch/master/graph/badge.svg
759759
[cover-url]: https://codecov.io/gh/webpack-contrib/file-loader
760760
[chat]: https://img.shields.io/badge/gitter-webpack%2Fwebpack-brightgreen.svg

‎azure-pipelines.yml

-200
This file was deleted.

‎lint-staged.config.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
module.exports = {
2-
'*.js': ['prettier --write', 'eslint --fix', 'git add'],
3-
'*.{json,md,yml,css,ts}': ['prettier --write', 'git add'],
2+
'*.js': ['prettier --write', 'eslint --fix'],
3+
'*.{json,md,yml,css,ts}': ['prettier --write'],
44
};

‎package-lock.json

+992-1,043
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+13-16
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"build": "cross-env NODE_ENV=production babel src -d dist --copy-files",
2323
"commitlint": "commitlint --from=master",
2424
"security": "npm audit",
25-
"lint:prettier": "prettier \"{**/*,*}.{js,json,md,yml,css,ts}\" --list-different",
25+
"lint:prettier": "prettier --list-different .",
2626
"lint:js": "eslint --cache .",
2727
"lint": "npm-run-all -l -p \"lint:**\"",
2828
"test:only": "cross-env NODE_ENV=test jest",
@@ -42,35 +42,32 @@
4242
},
4343
"dependencies": {
4444
"loader-utils": "^2.0.0",
45-
"schema-utils": "^2.6.5"
45+
"schema-utils": "^2.6.6"
4646
},
4747
"devDependencies": {
4848
"@babel/cli": "^7.8.4",
49-
"@babel/core": "^7.8.7",
50-
"@babel/preset-env": "^7.8.7",
49+
"@babel/core": "^7.9.0",
50+
"@babel/preset-env": "^7.9.5",
5151
"@commitlint/cli": "^8.3.5",
5252
"@commitlint/config-conventional": "^8.3.4",
5353
"@webpack-contrib/defaults": "^6.3.0",
5454
"@webpack-contrib/eslint-config-webpack": "^3.0.0",
55-
"babel-jest": "^25.1.0",
56-
"commitlint-azure-pipelines-cli": "^1.0.3",
55+
"babel-jest": "^25.4.0",
5756
"cross-env": "^7.0.2",
5857
"del": "^5.1.0",
5958
"del-cli": "^3.0.0",
6059
"eslint": "^6.8.0",
61-
"eslint-config-prettier": "^6.10.0",
62-
"eslint-plugin-import": "^2.20.1",
63-
"husky": "^4.2.3",
64-
"jest": "^25.1.0",
65-
"jest-junit": "^10.0.0",
66-
"lint-staged": "^10.0.8",
60+
"eslint-config-prettier": "^6.11.0",
61+
"eslint-plugin-import": "^2.20.2",
62+
"husky": "^4.2.5",
63+
"jest": "^25.4.0",
64+
"lint-staged": "^10.1.7",
6765
"memfs": "^3.1.2",
68-
"memory-fs": "^0.5.0",
6966
"npm-run-all": "^4.1.5",
70-
"prettier": "^1.19.1",
67+
"prettier": "^2.0.5",
7168
"standard-version": "^7.1.0",
72-
"url-loader": "^3.0.0",
73-
"webpack": "^4.42.0"
69+
"url-loader": "^4.1.0",
70+
"webpack": "^4.43.0"
7471
},
7572
"keywords": [
7673
"webpack"

‎test/helpers/normalizeErrors.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,6 @@ function removeCWD(str) {
1414

1515
export default (errors) => {
1616
return errors.map((error) =>
17-
removeCWD(
18-
error
19-
.toString()
20-
.split('\n')
21-
.slice(0, 2)
22-
.join('\n')
23-
)
17+
removeCWD(error.toString().split('\n').slice(0, 2).join('\n'))
2418
);
2519
};

0 commit comments

Comments
 (0)
This repository has been archived.