mirror of
https://github.com/tiennm99/is-a-dev.git
synced 2026-05-14 06:58:57 +00:00
fix tests
This commit is contained in:
@@ -24,8 +24,6 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- run: npm install
|
||||
|
||||
@@ -43,15 +41,11 @@ jobs:
|
||||
|
||||
- name: Get changed files
|
||||
if: github.event_name == 'pull_request'
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
script: |
|
||||
const { execSync } = require("child_process");
|
||||
const files = execSync(`git diff --name-only HEAD HEAD~${context.payload.pull_request.commits}`)
|
||||
.toString()
|
||||
.split("\n")
|
||||
.filter(Boolean);
|
||||
core.exportVariable("CHANGED_FILES", JSON.stringify(files));
|
||||
run: |
|
||||
FILES=$(gh api --jq '[.files[].filename]' /repos/{owner}/{repo}/pulls/${{ github.event.number }}/files)
|
||||
echo "CHANGED_FILES=$FILES" >> $GITHUB_ENV
|
||||
env:
|
||||
GH_TOKEN: ${{ github.token }}
|
||||
|
||||
- name: Run tests
|
||||
run: npx ava tests/*.test.js --timeout=30s
|
||||
run: npx ava tests/*.test.js --timeout=1m
|
||||
|
||||
Reference in New Issue
Block a user