Skip to content

Commit 3b212cd

Browse files
authored
chore(ci): use (Linux/macOS portable) temporary folder for template tests (probot#363)
1 parent 6026ccd commit 3b212cd

File tree

4 files changed

+2
-5
lines changed

4 files changed

+2
-5
lines changed

.github/workflows/test.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ jobs:
1818
- uses: actions/setup-node@v2
1919
with:
2020
node-version: ${{ matrix.node }}
21-
- run: npm install
21+
- run: npm ci
2222
- run: npm run build
23-
- run: npm run test:clean
2423
# XXX: might be possible to parallelize each template test too, .e.g. `npm run test:template ${{ matrix.template }}`
2524
- run: npm run test
2625

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ yarn.lock
1212

1313
# Test-related generated folders
1414
coverage
15-
tmp-test
1615

1716
# Miscellaneous
1817
.DS_Store

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
"scripts": {
1313
"test": "./script/test-all-templates.sh",
1414
"test:template": "./script/test-template.sh",
15-
"test:clean": "rimraf tmp-test",
1615
"lint": "prettier --ignore-path .gitignore --check '**/*.{js,ts,json,yml,md}'",
1716
"lint:fix": "prettier --ignore-path .gitignore --write '**/*.{js,ts,json,yml,md}'",
1817
"dev": "tsc-watch --onFirstSuccess \"npm run dev:make-exec\"",

script/test-template.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ set -o pipefail # Exit when any program execution in a pipeline breaks
55

66
readonly APP="./bin/create-probot-app.js"
77
readonly TEMPLATE=$1
8-
readonly TEST_FOLDER="./tmp-test/${TEMPLATE}"
8+
readonly TEST_FOLDER=$(mktemp -d -t cpa-XXXXXXXXXX)
99
readonly LOGFILENAME="test.output"
1010
readonly LOGFILE="${TEST_FOLDER}/${LOGFILENAME}"
1111

0 commit comments

Comments
 (0)