diff --git a/.github/workflows/test.yml b/.github/workflows/test-external.yml similarity index 87% rename from .github/workflows/test.yml rename to .github/workflows/test-external.yml index 676d63dd6..f1cd77924 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test-external.yml @@ -1,4 +1,4 @@ -name: Test +name: Test External on: push: @@ -7,7 +7,7 @@ on: branches: [master] jobs: - test: + test-external: runs-on: ubuntu-latest strategy: @@ -35,5 +35,5 @@ jobs: - name: Install dependencies run: npm install - - name: Run tests - run: npm test + - name: Run external tests + run: npm run test-external diff --git a/.github/workflows/test-internal.yml b/.github/workflows/test-internal.yml new file mode 100644 index 000000000..fd7e6bc16 --- /dev/null +++ b/.github/workflows/test-internal.yml @@ -0,0 +1,39 @@ +name: Test Internal + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + test-internal: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [10.x, 12.x, 14.x] + fail-fast: false + + steps: + - name: Checkout project + uses: actions/checkout@v2.3.4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2.4.0 + with: + node-version: ${{ matrix.node-version }} + + - name: Cache Node dependencies + uses: actions/cache@v2.1.6 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }} + restore-keys: | + ${{ runner.os }}-node- + + - name: Install dependencies + run: npm install + + - name: Run internal tests + run: npm run test-internal diff --git a/README.md b/README.md index e2cda01c8..fd687aa9a 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,8 @@

discord - status badge Node tests + External tests + Internal tests status badge old Node test npm version npm downloads diff --git a/package.json b/package.json index bf6819538..331623192 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,9 @@ "url": "git://github.com/standard/standard.git" }, "scripts": { - "test": "./bin/cmd.js --verbose && tape test/*.js", + "test": "npm run test-internal && npm run test-external", + "test-internal": "./bin/cmd.js --verbose && tape test/*.js", + "test-external": "tape test/external/*.js", "update-authors": "./tools/update-authors.sh && hallmark --fix AUTHORS.md" }, "funding": [ diff --git a/test/clone.js b/test/external/clone.js similarity index 97% rename from test/clone.js rename to test/external/clone.js index 4ca69fa17..1dfc1aa04 100644 --- a/test/clone.js +++ b/test/external/clone.js @@ -17,8 +17,8 @@ const testPkgs = require('./test.json') const GIT = 'git' const NPM = 'npm' -const STANDARD = path.join(__dirname, '..', 'bin', 'cmd.js') -const TMP = path.join(__dirname, '..', 'tmp') +const STANDARD = path.join(__dirname, '..', '..', 'bin', 'cmd.js') +const TMP = path.join(__dirname, '..', '..', 'tmp') const PARALLEL_LIMIT = Math.ceil(os.cpus().length / 2) const argv = minimist(process.argv.slice(2), { diff --git a/test/test.json b/test/external/test.json similarity index 100% rename from test/test.json rename to test/external/test.json