Skip to content

Commit

Permalink
chore(ci): rebuild cmark-gfm only before tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Sep 21, 2022
1 parent 9f5e6bd commit a1ef180
Show file tree
Hide file tree
Showing 18 changed files with 38 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/ci-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w docs
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmaccess.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmaccess
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmdiff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmdiff
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmexec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmexec
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmfund.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmfund
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmhook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmhook
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmorg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmorg
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmpack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmpack
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmpublish
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmsearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmsearch
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmteam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmteam
2 changes: 2 additions & 0 deletions .github/workflows/ci-libnpmversion.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w libnpmversion
2 changes: 2 additions & 0 deletions .github/workflows/ci-npmcli-arborist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w @npmcli/arborist
2 changes: 2 additions & 0 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -ws -iwr --if-present
- name: Conclude Check
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-smoke-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,7 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -w smoke-tests
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ jobs:
- name: Link
if: matrix
run: node . link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: node . rebuild cmark-gfm
- name: Test
run: node . test --ignore-scripts -iwr
- name: Check Git Status
Expand Down
16 changes: 4 additions & 12 deletions docs/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,11 @@ const output = join(cwd, 'output')

const rmOutput = () => fs.rm(output, { recursive: true, force: true }).catch(() => {})

const spawnNpm = (cmd, ...args) => {
// remove npm config when spawning so config set by test commands don't interfere
const env = Object.entries(process.env)
.filter(([k]) => k.toLowerCase() !== 'npm_config_ignore_scripts')

return spawn(which(cmd), args, {
env: Object.fromEntries(env),
stdioString: true,
cwd,
})
}
const spawnNpm = (cmd, ...args) => spawn(which(cmd), args, {
stdioString: true,
cwd,
})

t.before(() => spawnNpm('node', '..', 'rebuild', 'cmark-gfm'))
t.beforeEach(() => rmOutput())

t.test('docs', async (t) => {
Expand Down
2 changes: 2 additions & 0 deletions scripts/template-oss/_step-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,7 @@
- name: Link
if: matrix
run: {{ rootNpmPath }} link -f --ignore-scripts
- name: Rebuild cmark-gfm
run: {{ rootNpmPath }} rebuild cmark-gfm
- name: Test
run: {{ rootNpmPath }} test --ignore-scripts {{~#if jobRunFlags}} {{ jobRunFlags }}{{/if}}

0 comments on commit a1ef180

Please sign in to comment.