Skip to content

Commit

Permalink
ci: add danger for this project
Browse files Browse the repository at this point in the history
  • Loading branch information
tomassebestik committed Nov 29, 2023
1 parent a22a2fc commit 0d2b992
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 11 deletions.
19 changes: 8 additions & 11 deletions .github/workflows/codebase-tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Codebase-Tests
name: Codebase tests (Jest)

on:
pull_request:
Expand All @@ -10,17 +10,14 @@ on:
jobs:
codebase-tests:
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x]

steps:
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- name: Repository checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
Expand All @@ -30,7 +27,7 @@ jobs:
run: npm test

- name: Publish Test Report
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: always()
with:
name: junit-report
Expand Down
25 changes: 25 additions & 0 deletions .github/workflows/danger-this.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: DangerJS (contributors)
on:
pull_request:
types: [opened, edited, reopened, synchronize]

jobs:
danger:
runs-on: ubuntu-latest
steps:
- name: Repository checkout
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'npm'

- name: Install dependencies
run: npm install --no-progress --no-update-notifier

- name: Run DangerJS
run: npx danger --dangerfile=src/dangerfile.ts ci
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29 changes: 29 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Pre-commit hooks CI
on:
pull_request:
types: [opened, edited, reopened, synchronize]
push:
branches: [ master ]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.9'

- name: Install pre-commit
run: pip install pre-commit

- name: Run pre-commit on changed files
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git diff --name-only FETCH_HEAD $(git merge-base FETCH_HEAD ${{ github.base_ref }}) | xargs pre-commit run --files
env:
SKIP: "conventional-precommit-linter,eslint"
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ This is the DangerJS pull request linter GitHub action, that can be called from
-TBD-
-TBD-
-TBD-

<!-- BADGES -->

![Codebase tests (Jest)](<https://github.com/espressif/shared-github-dangerjs/workflows/Codebase%20tests%20(Jest)/badge.svg>)

0 comments on commit 0d2b992

Please sign in to comment.