Add a small contribution auto-reviewer
This commit is contained in:
4
.github/workflows/workflow.yml
vendored
4
.github/workflows/workflow.yml
vendored
@@ -25,6 +25,8 @@ jobs:
|
|||||||
node-version: 15
|
node-version: 15
|
||||||
- name: Setup metrics
|
- name: Setup metrics
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
- name: Check contributions requirements
|
||||||
|
run: npm test -- ci.test.js
|
||||||
- name: Run linter
|
- name: Run linter
|
||||||
run: npm run linter
|
run: npm run linter
|
||||||
|
|
||||||
@@ -39,7 +41,7 @@ jobs:
|
|||||||
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
- name: Build lowlighter/metrics:${{ github.head_ref || 'master' }}
|
||||||
run: docker build -t lowlighter/metrics:${{ github.head_ref || 'master' }} .
|
run: docker build -t lowlighter/metrics:${{ github.head_ref || 'master' }} .
|
||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:${{ github.head_ref || 'master' }} npm test
|
run: docker run --workdir=/metrics --entrypoint="" lowlighter/metrics:${{ github.head_ref || 'master' }} npm test -- metrics.test.js
|
||||||
|
|
||||||
# Run CodeQL on branch
|
# Run CodeQL on branch
|
||||||
analyze:
|
analyze:
|
||||||
|
|||||||
13
tests/ci.test.js
Normal file
13
tests/ci.test.js
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
//Imports
|
||||||
|
const path = require("path")
|
||||||
|
const git = require("simple-git")(path.join(__dirname, ".."))
|
||||||
|
|
||||||
|
//Check generated files editions
|
||||||
|
const diff = async () => (await git.diff("master...", ["--name-status"])).split("\n").map(x => x.trim()).filter(x => /^M\s+/.test(x)).map(x => x.replace(/^M\s+/, ""))
|
||||||
|
describe('Auto-generated files were not modified (use "git checkout @ -- file" if needed)', () => void test.each([
|
||||||
|
"README.md",
|
||||||
|
"source/plugins/README.md",
|
||||||
|
"source/templates/README.md",
|
||||||
|
"action.yml",
|
||||||
|
"settings.example.json"
|
||||||
|
])("%s", async file => expect((await diff()).includes(file)).toBe(false)))
|
||||||
Reference in New Issue
Block a user