-
Notifications
You must be signed in to change notification settings - Fork 165
119 lines (101 loc) · 3.43 KB
/
analysis-coverage.yml
File metadata and controls
119 lines (101 loc) · 3.43 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
# SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
# SPDX-License-Identifier: MIT
name: Analysis & Coverage
on:
pull_request:
push:
branches:
- master
jobs:
test:
permissions:
contents: read
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
db-type: [postgres, sqlite]
services:
postgres:
image: postgres:14
env:
POSTGRES_USER: postgres
POSTGRES_DB: nextcloudappstore
POSTGRES_PASSWORD: postgres
ports:
- 5432:5432
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
path: ${{ env.APP_NAME }}
submodules: true
- name: Install dependencies
run: sudo apt install gettext netcat-openbsd xvfb redis-server
- name: Set up Python
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
with:
python-version: '3.12'
- name: Install poetry
run: pip install poetry==1.8.2
- uses: browser-actions/setup-firefox@5914774dda97099441f02628f8d46411fcfbd208 # v1.7.0
with:
firefox-version: latest
- name: Set up Geckodriver
uses: browser-actions/setup-geckodriver@5ef1526ed36211ab6cb531ec1cfb11f924ca2dee # latest
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up node ${{ steps.versions.outputs.nodeVersion }}
# Skip if no package.json
if: ${{ steps.versions.outputs.nodeVersion }}
uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0
with:
node-version: ${{ steps.versions.outputs.nodeVersion }}
- name: Make dev-setup
run: |
make dev-setup db="${{ matrix.db-type }}" venv_bin=""
make l10n venv_bin=""
npm install tslint
- name: Linter
run: ./node_modules/.bin/tslint "./nextcloudappstore/core/static/assets/**/*.ts"
- name: Generate coverage report
run: |
xvfb-run --auto-servernum --server-args="-screen 0 1920x1080x8" make test venv_bin=""
make coverage venv_bin=""
- name: Upload Codecov to artifacts
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: coverage_${{ matrix.db-type }}.xml
path: coverage.xml
if-no-files-found: error
upload-codecov:
needs: [ test ]
permissions:
contents: none
runs-on: ubuntu-24.04
name: Upload Coverage
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
with:
persist-credentials: false
path: ${{ env.APP_NAME }}
- name: Download Coverage Artifacts
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
with:
path: coverage
pattern: coverage_*
merge-multiple: true
- name: Upload report to Codecov
uses: codecov/codecov-action@5a1091511ad55cbe89839c7260b706298ca349f7 # v5.5.1
with:
token: ${{ secrets.CODECOV_TOKEN }}
directory: coverage
fail_ci_if_error: true
verbose: true