diff --git a/.github/workflows/codebase-tests.yml b/.github/workflows/codebase-tests.yml index 787a322..129f16e 100644 --- a/.github/workflows/codebase-tests.yml +++ b/.github/workflows/codebase-tests.yml @@ -1,4 +1,4 @@ -name: Codebase-Tests +name: Codebase tests (Jest) on: pull_request: @@ -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 @@ -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 diff --git a/.github/workflows/danger-this.yml b/.github/workflows/danger-this.yml new file mode 100644 index 0000000..e69540a --- /dev/null +++ b/.github/workflows/danger-this.yml @@ -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 }} diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..e1ff89c --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -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" diff --git a/README.md b/README.md index 53dfa1d..bea1d73 100644 --- a/README.md +++ b/README.md @@ -5,3 +5,7 @@ This is the DangerJS pull request linter GitHub action, that can be called from -TBD- -TBD- -TBD- + + + +![Codebase tests (Jest)]()