-
Notifications
You must be signed in to change notification settings - Fork 4
86 lines (85 loc) · 2.6 KB
/
Copy pathpre-merge-checks.yml
File metadata and controls
86 lines (85 loc) · 2.6 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Pre-merge checks
on:
push:
branches:
- main
pull_request:
types:
- opened
- reopened
- ready_for_review
- synchronize
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-python@v6
with:
python-version: '3.11.2'
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
with:
extra_args: "detect-secrets --all-files"
run-tests:
runs-on: ubuntu-latest
permissions:
packages: read
timeout-minutes: 15
steps:
- uses: actions/checkout@v6
- name: Use Node.js 22.x
uses: actions/setup-node@v6
with:
node-version: 22.14.0
- name: Setup .npmrc
run: |
cp .npmrc.template .npmrc && \
sed -i s/TOKEN_WITH_READ_PACKAGE_PERMISSION/${{ secrets.GITHUB_TOKEN }}/ .npmrc
- name: Login to GDS Dev Dynatrace Container Registry
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3.6.0
with:
registry: khw46367.live.dynatrace.com
username: khw46367
password: ${{ secrets.DYNATRACE_PAAS_TOKEN }}
- name: Install dependencies
run: npm ci
- name: Run lint
run: npm run lint
- name: Run test and write coverage
run: npm run test:coverage
- name: Run sonarcloud scan
if: ${{ github.actor != 'dependabot[bot]' }}
uses: sonarsource/sonarcloud-github-action@ffc3010689be73b8e5ae0c57ce35968afd7909e8 # v5.0.0
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} # obtained from https://sonarcloud.io
- name: Build docker image
run: |
cd "${GITHUB_WORKSPACE}" || exit 1
docker build -t "core-front-build:test" .
browser-tests:
name: Run browser tests
runs-on: ubuntu-latest
permissions:
packages: read
defaults:
run:
shell: bash
working-directory: browser-tests
steps:
- name: Pull repository
uses: actions/checkout@v6
- name: Setup .npmrc
run: |
cp ../.npmrc.template ../.npmrc && \
sed -i s/TOKEN_WITH_READ_PACKAGE_PERMISSION/${{ secrets.GITHUB_TOKEN }}/ ../.npmrc
- name: Run browser tests
run: docker compose up --exit-code-from browser-tests-tests
- name: Upload test artifacts
if: ${{ failure() }}
uses: actions/upload-artifact@v5
with:
name: browser-test-results
path: ./browser-tests/test-results/
- name: Stop Docker
if: ${{ always() }}
run: docker compose down