Skip to content

Commit

Permalink
Chore(system-tests): add git hooks and pipeline integration
Browse files Browse the repository at this point in the history
NDISC-80
  • Loading branch information
weilbith committed Dec 20, 2023
1 parent 80e0b12 commit 2a897b6
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,39 @@ jobs:
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

########################
# system test jobs
########################

check-style-system-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version-file: ./system-tests/.node-version
cache: npm
cache-dependency-path: ./system-tests/package-lock.json
- name: Cache node_modules
uses: actions/cache@v3
id: node-modules-cache
with:
path: ./system-tests/node_modules
key: modules-${{ hashFiles('./system-tests/package-lock.json') }}
- name: Install dependencies
if: steps.node-modules-cache.outputs.cache-hit != 'true'
run: npm ci
working-directory: ./system-tests
- name: Check style
run: npm run style:check
working-directory: ./system-tests
- name: Send status to Slack
uses: digitalservicebund/notify-on-failure-gha@15dd05b628141b7bac0ad26e08c1935cb3ba6bc8 # v1.4.0
if: ${{ failure() && github.ref == 'refs/heads/main' }}
with:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}

################
# Security jobs
################
Expand Down
8 changes: 8 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ pre-commit:
glob: "*.{ts,js,json}"
run: npm run --silent eslint:fix {staged_files} && git add {staged_files}

check-format-system-tests:
root: system-tests/
run: npm run --silent prettier:fix {staged_files} && git add {staged_files}

lint-system-tests:
root: system-tests/
run: npm run --silent eslint:fix {staged_files} && git add {staged_files}

secrets-audit:
run: >
talisman --githook pre-commit ||
Expand Down

0 comments on commit 2a897b6

Please sign in to comment.