-
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
50bf912
commit 2df66e4
Showing
5 changed files
with
110 additions
and
48 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,2 +1,2 @@ | ||
*.ts eol=lf | ||
* text=auto eol=lf | ||
/test/fixtures/crlf.vue eol=crlf |
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 |
---|---|---|
|
@@ -12,45 +12,57 @@ jobs: | |
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- name: Checkout submodules | ||
run: git submodule update --init | ||
- name: Install Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 12 | ||
- name: Install Packages | ||
run: npm install | ||
- name: Lint | ||
run: npm run -s lint | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Checkout submodules | ||
run: git submodule update --init | ||
- name: Install Node.js | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install Packages | ||
run: npm install | ||
- name: Lint | ||
run: npm run -s lint | ||
|
||
test: | ||
name: Test | ||
|
||
strategy: | ||
matrix: | ||
eslint: [6, 5] | ||
node: [13, 12, 10, 8, "8.10.0"] | ||
exclude: | ||
# Run ESLint 5 on only the LTS. | ||
- node: 13 | ||
eslint: 5 | ||
- node: 10 | ||
eslint: 5 | ||
- node: 8 | ||
eslint: 5 | ||
- node: "8.10.0" | ||
eslint: 5 | ||
eslint: [7] | ||
node: [14] | ||
os: [ubuntu-latest] | ||
include: | ||
# On other platforms | ||
- eslint: 7 | ||
node: 14 | ||
os: windows-latest | ||
- eslint: 7 | ||
node: 14 | ||
os: macos-latest | ||
# On old Node.js versions | ||
- eslint: 7 | ||
node: 12 | ||
os: ubuntu-latest | ||
- eslint: 7 | ||
node: 10 | ||
os: ubuntu-latest | ||
# On old ESLint versions | ||
- eslint: 6 | ||
node: 14 | ||
os: ubuntu-latest | ||
- eslint: 5 | ||
node: 14 | ||
os: ubuntu-latest | ||
# On the minimum supported ESLint/Node.js version | ||
- eslint: 5 | ||
node: 8.10.0 | ||
os: ubuntu-latest | ||
|
||
runs-on: ubuntu-latest | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
uses: actions/checkout@v2 | ||
- name: Checkout submodules | ||
run: git submodule update --init | ||
- name: Install Node.js v${{ matrix.node }} | ||
|
@@ -60,17 +72,7 @@ jobs: | |
- name: Install Packages | ||
run: npm install | ||
- name: Install ESLint v${{ matrix.eslint }} | ||
run: | | ||
if [ ${{ matrix.eslint }} -eq 6 ]; then | ||
cd test/fixtures/eslint | ||
npm install | ||
else | ||
npm install --no-save [email protected] | ||
cd test/fixtures/eslint | ||
git checkout v5.16.0 | ||
npm install [email protected] | ||
npm install | ||
fi | ||
run: node scripts/ci-install-eslint ${{ matrix.eslint }} | ||
- name: Build | ||
run: npm run -s build | ||
- name: Test | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
"use strict" | ||
|
||
const { spawn } = require("child_process") | ||
|
||
function cd(path) { | ||
console.log("$ cd %s", path) | ||
process.chdir(path) | ||
} | ||
|
||
function sh(command) { | ||
console.log("$ %s", command) | ||
return new Promise((resolve, reject) => { | ||
spawn(command, [], { shell: true, stdio: "inherit" }) | ||
.on("error", reject) | ||
.on("exit", exitCode => { | ||
if (exitCode) { | ||
reject(new Error(`Exit with non-zero ${exitCode}`)) | ||
} else { | ||
resolve() | ||
} | ||
}) | ||
}) | ||
} | ||
|
||
;(async function main() { | ||
const requestedVersion = process.argv[2] | ||
const requestedVersionSpec = /^\d+\.\d+\.\d+$/u.test(requestedVersion) | ||
? requestedVersion | ||
: `^${requestedVersion}` | ||
|
||
// Install ESLint of the requested version | ||
await sh(`npm install eslint@${requestedVersionSpec}`) | ||
|
||
// Install ESLint submodule of the requested version | ||
const installedVersion = require("eslint").CLIEngine.version | ||
cd("test/fixtures/eslint") | ||
if (!installedVersion.startsWith("7.")) { | ||
await sh(`git checkout v${installedVersion}`) | ||
} | ||
if (installedVersion.startsWith("5.")) { | ||
await sh("npm install [email protected]") | ||
} | ||
await sh("npm install") | ||
})().catch(error => { | ||
console.error(error) | ||
process.exitCode = 1 | ||
}) |
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