-
Notifications
You must be signed in to change notification settings - Fork 0
51 lines (51 loc) · 1.43 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
---
name: CI
on:
pull_request:
types:
- opened
- synchronize
- reopened
push:
branches:
- trunk
permissions:
contents: write
pull-requests: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4.0.2
with:
node-version-file: '.node-version'
cache: 'npm'
cache-dependency-path: '**/package-lock.json'
- run: npm ci
- run: npm run lint
- run: npm run build
- run: npm run test
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
- run: npm run terraform init
- run: npm run terraform validate
merge:
needs: build
if: ${{github.event_name == 'pull_request' && github.actor == 'dependabot[bot]'}}
runs-on: ubuntu-latest
steps:
- id: metadata
uses: dependabot/fetch-metadata@v1
with:
github-token: "${{secrets.GITHUB_TOKEN}}"
- if: ${{steps.metadata.outputs.update-type == 'version-update:semver-major'}}
run: gh run cancel ${{github.run_id}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
- if: ${{steps.metadata.outputs.update-type != 'version-update:semver-major'}}
run: gh pr merge --auto --squash ${{github.event.pull_request.html_url}}
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}