@npmcli/template-oss 2.4.1 → 2.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# This file is automatically added by @npmcli/template-oss. Do not edit.
|
|
2
|
+
|
|
3
|
+
name: CI
|
|
4
|
+
|
|
5
|
+
on:
|
|
6
|
+
pull_request:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
- main
|
|
10
|
+
- latest
|
|
11
|
+
schedule:
|
|
12
|
+
# "At 02:00 on Monday" https://crontab.guru/#0_1_*_*_1
|
|
13
|
+
- cron: "0 2 * * 1"
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
lint:
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v2
|
|
20
|
+
- uses: actions/setup-node@v2
|
|
21
|
+
with:
|
|
22
|
+
node-version: '16'
|
|
23
|
+
- run: npm i --prefer-online -g npm@latest
|
|
24
|
+
- run: npm i
|
|
25
|
+
- run: npm run lint
|
|
26
|
+
|
|
27
|
+
test:
|
|
28
|
+
strategy:
|
|
29
|
+
fail-fast: false
|
|
30
|
+
matrix:
|
|
31
|
+
node-version: [12.13.0, 12.x, 14.15.0, 14.x, 16.13.0, 16.x]
|
|
32
|
+
platform:
|
|
33
|
+
- os: ubuntu-latest
|
|
34
|
+
shell: bash
|
|
35
|
+
- os: macos-latest
|
|
36
|
+
shell: bash
|
|
37
|
+
runs-on: ${{ matrix.platform.os }}
|
|
38
|
+
defaults:
|
|
39
|
+
run:
|
|
40
|
+
shell: ${{ matrix.platform.shell }}
|
|
41
|
+
steps:
|
|
42
|
+
- uses: actions/checkout@v2
|
|
43
|
+
- uses: actions/setup-node@v2
|
|
44
|
+
with:
|
|
45
|
+
node-version: ${{ matrix.node-version }}
|
|
46
|
+
- run: npm i --prefer-online -g npm@latest
|
|
47
|
+
- run: npm i
|
|
48
|
+
- run: npm test --ignore-scripts
|
|
@@ -30,7 +30,7 @@ jobs:
|
|
|
30
30
|
node ./bin/npm-cli.js install --ignore-scripts --no-audit
|
|
31
31
|
node ./bin/npm-cli.js rebuild
|
|
32
32
|
- name: Run linting
|
|
33
|
-
run: node ./bin/npm-cli.js run posttest -w
|
|
33
|
+
run: node ./bin/npm-cli.js run posttest -w %%pkgpath%%
|
|
34
34
|
env:
|
|
35
35
|
DEPLOY_VERSION: testing
|
|
36
36
|
|
|
@@ -73,4 +73,4 @@ jobs:
|
|
|
73
73
|
|
|
74
74
|
# Run the tests, but not if we're just gonna do coveralls later anyway
|
|
75
75
|
- name: Run Tap tests
|
|
76
|
-
run: node ./bin/npm-cli.js run -w
|
|
76
|
+
run: node ./bin/npm-cli.js run -w %%pkgpath%% --ignore-scripts test -- -t600 -Rbase -c
|
|
@@ -38,6 +38,7 @@ const defaultConfig = {
|
|
|
38
38
|
applyRootRepoFiles: true,
|
|
39
39
|
applyWorkspaceRepoFiles: true,
|
|
40
40
|
applyRootModuleFiles: true,
|
|
41
|
+
windowsCI: true,
|
|
41
42
|
}
|
|
42
43
|
|
|
43
44
|
const copyFiles = async (targetDir, files) => {
|
|
@@ -78,9 +79,18 @@ const copyContent = async (path, rootPath, config) => {
|
|
|
78
79
|
if (!isWorkspace) {
|
|
79
80
|
if (config.applyRootRepoFiles) {
|
|
80
81
|
await copyFiles(rootPath, repoFiles)
|
|
82
|
+
if (!config.windowsCI) {
|
|
83
|
+
// copyFiles already did the mkdir so we can just fs.copyFile now
|
|
84
|
+
await fs.copyFile(
|
|
85
|
+
join(contentDir, 'ci-no-windows.yml'),
|
|
86
|
+
join(rootPath, '.github', 'workflows', 'ci.yml')
|
|
87
|
+
)
|
|
88
|
+
}
|
|
81
89
|
}
|
|
82
90
|
return
|
|
83
|
-
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// only workspace now
|
|
84
94
|
|
|
85
95
|
// TODO: await copyFiles(path, workspaceFiles)
|
|
86
96
|
// if we ever have workspace specific files
|
|
@@ -89,6 +99,8 @@ const copyContent = async (path, rootPath, config) => {
|
|
|
89
99
|
// copy and edit workspace repo file (ci github action)
|
|
90
100
|
const workspacePkg = (await PackageJson.load(path)).content
|
|
91
101
|
const workspaceName = workspacePkg.name
|
|
102
|
+
let workspaceFile = `ci-${workspaceName.replace(/\//g, '-')}.yml`
|
|
103
|
+
workspaceFile = workspaceFile.replace(/@/g, '')
|
|
92
104
|
const workflowPath = join(rootPath, '.github', 'workflows')
|
|
93
105
|
await fs.mkdir(workflowPath, {
|
|
94
106
|
owner: 'inherit',
|
|
@@ -105,7 +117,7 @@ const copyContent = async (path, rootPath, config) => {
|
|
|
105
117
|
workflowData = workflowData.replace(/%%pkgpath%%/g, relPath)
|
|
106
118
|
workflowData = workflowData.replace(/%%pkgname%%/g, workspaceName)
|
|
107
119
|
|
|
108
|
-
await fs.writeFile(join(workflowPath,
|
|
120
|
+
await fs.writeFile(join(workflowPath, workspaceFile), workflowData)
|
|
109
121
|
}
|
|
110
122
|
}
|
|
111
123
|
copyContent.moduleFiles = moduleFiles
|