Merge branch 'danger-maybe' into 'develop'
Danger: try branch pipeline hack See merge request soapbox-pub/soapbox-fe!1544
This commit is contained in:
commit
49f156dc65
4 changed files with 630 additions and 12 deletions
|
@ -3,12 +3,13 @@ image: node:18
|
||||||
variables:
|
variables:
|
||||||
NODE_ENV: test
|
NODE_ENV: test
|
||||||
|
|
||||||
cache:
|
cache: &cache
|
||||||
key:
|
key:
|
||||||
files:
|
files:
|
||||||
- yarn.lock
|
- yarn.lock
|
||||||
paths:
|
paths:
|
||||||
- node_modules/
|
- node_modules/
|
||||||
|
policy: pull
|
||||||
|
|
||||||
stages:
|
stages:
|
||||||
- deps
|
- deps
|
||||||
|
@ -21,6 +22,16 @@ deps:
|
||||||
only:
|
only:
|
||||||
changes:
|
changes:
|
||||||
- yarn.lock
|
- yarn.lock
|
||||||
|
cache:
|
||||||
|
<<: *cache
|
||||||
|
policy: push
|
||||||
|
|
||||||
|
danger:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
# https://github.com/danger/danger-js/issues/1029#issuecomment-998915436
|
||||||
|
- export CI_MERGE_REQUEST_IID=${CI_OPEN_MERGE_REQUESTS#*!}
|
||||||
|
- npx danger ci
|
||||||
|
|
||||||
lint-js:
|
lint-js:
|
||||||
stage: test
|
stage: test
|
||||||
|
|
13
dangerfile.ts
Normal file
13
dangerfile.ts
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
import { danger, warn, message } from 'danger';
|
||||||
|
|
||||||
|
const docs = danger.git.fileMatch('docs/**/*.md');
|
||||||
|
const app = danger.git.fileMatch('app/**/*.(js|ts|tsx)');
|
||||||
|
const tests = danger.git.fileMatch('*/__tests__/*');
|
||||||
|
|
||||||
|
if (docs.edited) {
|
||||||
|
message('Thanks - We :heart: our [documentarians](http://www.writethedocs.org/)!');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (app.modified && !tests.modified) {
|
||||||
|
warn('You have app changes without tests.');
|
||||||
|
}
|
|
@ -209,6 +209,7 @@
|
||||||
"babel-eslint": "^10.1.0",
|
"babel-eslint": "^10.1.0",
|
||||||
"babel-jest": "^28.1.0",
|
"babel-jest": "^28.1.0",
|
||||||
"cross-env": "^7.0.3",
|
"cross-env": "^7.0.3",
|
||||||
|
"danger": "^11.0.7",
|
||||||
"eslint": "^7.0.0",
|
"eslint": "^7.0.0",
|
||||||
"eslint-plugin-import": "^2.25.4",
|
"eslint-plugin-import": "^2.25.4",
|
||||||
"eslint-plugin-jsdoc": "^39.2.9",
|
"eslint-plugin-jsdoc": "^39.2.9",
|
||||||
|
|
Loading…
Reference in a new issue