Skip to content

Commit 5c8a795

Browse files
ci: CICD (#32)
* ci: CICD * test: ESLint v9 * ci: Remove Node v18 * test: Linting * ci: Testing * ci: Testing * ci: Testing
1 parent 89ff947 commit 5c8a795

21 files changed

+5422
-5791
lines changed

.eslintignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.eslintrc.yaml

Lines changed: 0 additions & 3 deletions
This file was deleted.

.github/FUNDING.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/auto-assign.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Auto-assign Issue + PR
2+
3+
on:
4+
issues:
5+
types: [opened]
6+
pull_request:
7+
types: [opened, edited, synchronize, reopened]
8+
9+
permissions: read-all
10+
11+
jobs:
12+
auto-assign:
13+
permissions:
14+
issues: write
15+
uses: mauriciolauffer/.github/.github/workflows/auto-assign.yml@main
Lines changed: 3 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,14 @@
1-
# For most projects, this workflow file will not need changing; you simply need
2-
# to commit it to your repository.
3-
#
4-
# You may wish to alter this file to override the set of languages analyzed,
5-
# or to provide custom queries or build logic.
6-
#
7-
# ******** NOTE ********
8-
# We have attempted to detect the languages in your repository. Please check
9-
# the `language` matrix defined below to confirm you have the correct set of
10-
# supported CodeQL languages.
11-
#
12-
name: "CodeQL"
1+
name: CodeQL
132

143
on:
154
push:
16-
branches: [ master ]
5+
branches: [master]
176
pull_request:
187

198
permissions: read-all
209

2110
jobs:
2211
analyze:
23-
name: Analyze
24-
runs-on: ubuntu-latest
2512
permissions:
2613
security-events: write
27-
28-
strategy:
29-
fail-fast: false
30-
matrix:
31-
language: [ 'javascript' ]
32-
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
33-
# Learn more about CodeQL language support at https://git.io/codeql-language-support
34-
35-
steps:
36-
- name: Checkout repository
37-
uses: actions/checkout@v4
38-
with:
39-
persist-credentials: false
40-
41-
# Initializes the CodeQL tools for scanning.
42-
- name: Initialize CodeQL
43-
uses: github/codeql-action/init@v2
44-
with:
45-
languages: ${{ matrix.language }}
46-
# If you wish to specify custom queries, you can do so here or in a config file.
47-
# By default, queries listed here will override any specified in a config file.
48-
# Prefix the list here with "+" to use these queries and those in the config file.
49-
# queries: ./path/to/local/query, your-org/your-repo/queries@main
50-
51-
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@v2
14+
uses: mauriciolauffer/.github/.github/workflows/codeql-analysis.yml@main

.github/workflows/npm-publish.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,25 +2,15 @@ name: NPM Package Publish
22

33
on:
44
release:
5-
types: [created]
5+
types: [published]
6+
workflow_dispatch:
67

78
permissions: read-all
89

910
jobs:
1011
publish:
11-
runs-on: ubuntu-latest
1212
permissions:
1313
id-token: write
14-
steps:
15-
- uses: actions/checkout@v4
16-
- uses: actions/setup-node@v4
17-
with:
18-
node-version: 20
19-
registry-url: https://registry.npmjs.org
20-
cache: npm
21-
- run: npm i -g @ui5/cli --ignore-scripts
22-
- run: npm ci --ignore-scripts
23-
- run: npm run build
24-
- run: npm publish --provenance
25-
env:
26-
NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }}
14+
uses: mauriciolauffer/.github/.github/workflows/npm-publish.yml@main
15+
secrets:
16+
NODE_AUTH_TOKEN: ${{ secrets.NPM_SECRET }}

.github/workflows/release.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,11 @@ on:
33
push:
44
branches: [master]
55

6-
permissions: read-all
7-
86
jobs:
97
release:
10-
runs-on: ubuntu-latest
118
permissions:
129
contents: write
1310
pull-requests: write
14-
steps:
15-
- uses: google-github-actions/release-please-action@v4
16-
with:
17-
token: ${{ secrets.GH_PAT }}
18-
release-type: node
19-
package-name: openui5-tour
11+
uses: mauriciolauffer/.github/.github/workflows/release.yml@main
12+
secrets:
13+
GITHUB_PAT: ${{ secrets.GH_PAT }}

.github/workflows/scorecards-analysis.yml

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -3,44 +3,18 @@ on:
33
# Only the default branch is supported.
44
branch_protection_rule:
55
schedule:
6-
- cron: '30 5 * * 1'
6+
- cron: "10 5 * * 1"
77
push:
8-
branches: [ master ]
8+
branches: [master]
99

1010
# Declare default permissions as read only.
1111
permissions: read-all
1212

1313
jobs:
1414
analysis:
15-
name: Scorecards analysis
16-
runs-on: ubuntu-latest
1715
permissions:
18-
# Needed to upload the results to code-scanning dashboard.
1916
security-events: write
2017
id-token: write
21-
22-
steps:
23-
- name: "Checkout code"
24-
uses: actions/checkout@v4
25-
with:
26-
persist-credentials: false
27-
28-
- name: "Run analysis"
29-
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
30-
with:
31-
results_file: results.sarif
32-
results_format: sarif
33-
# Read-only PAT token. To create it,
34-
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
35-
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
36-
# Publish the results to enable scorecard badges. For more details, see
37-
# https://github.com/ossf/scorecard-action#publishing-results.
38-
# For private repositories, `publish_results` will automatically be set to `false`,
39-
# regardless of the value entered here.
40-
publish_results: true
41-
42-
# Upload the results to GitHub's code scanning dashboard.
43-
- name: "Upload to code-scanning"
44-
uses: github/codeql-action/upload-sarif@v2
45-
with:
46-
sarif_file: results.sarif
18+
uses: mauriciolauffer/.github/.github/workflows/scorecards-analysis.yml@main
19+
secrets:
20+
SCORECARD_READ_TOKEN: ${{ secrets.SCORECARD_READ_TOKEN }}

.github/workflows/test.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,35 @@
11
name: test
22
on:
33
push:
4-
branches: [ master ]
54
pull_request:
5+
schedule:
6+
- cron: "35 1 * * *"
7+
68

79
permissions: read-all
810

911
jobs:
1012
test:
1113
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
node-version: [20, 22]
1217
permissions:
1318
security-events: write
1419
steps:
1520
- uses: actions/checkout@v4
1621
with:
1722
persist-credentials: false
18-
- uses: actions/setup-node@v4
23+
- name: Use Node.js ${{ matrix.node-version }}
24+
uses: actions/setup-node@v4
1925
with:
26+
node-version: ${{ matrix.node-version }}
2027
cache: npm
2128
- run: npm i -g @ui5/cli concurrently --ignore-scripts
22-
- run: npm ci --ignore-scripts
29+
- run: npm ci
2330
- run: npm run build
2431
- run: npm run lint:ci
25-
- run: concurrently --kill-others --success last "npm:start:dist" "npm:test:ci"
26-
- uses: github/codeql-action/upload-sarif@v2
32+
- run: npm run start:test
33+
- uses: github/codeql-action/upload-sarif@v3
2734
with:
28-
sarif_file: target/eslint.sarif
35+
sarif_file: eslint.sarif

eslint.config.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
import globals from "globals";
2+
import { defineConfig } from "eslint/config";
3+
import ui5Config from "eslint-config-mlauffer-ui5";
4+
import { configs as wdioConfigs } from "eslint-plugin-wdio";
5+
6+
export default defineConfig([
7+
{
8+
name: "local-ignores",
9+
ignores: [
10+
"**/coverage/",
11+
"**/dist/",
12+
"**/gen/",
13+
"**/resources/",
14+
"**/thirdparty/"
15+
],
16+
},
17+
{
18+
files: ["src/**/*.js", "test/**/*.js", "demo/**/*.js"],
19+
extends: [ui5Config],
20+
},
21+
{
22+
files: ["test/**/*.js"],
23+
extends: [wdioConfigs["flat/recommended"]],
24+
languageOptions: {
25+
globals: {
26+
...globals.qunit,
27+
...globals.mocha,
28+
},
29+
},
30+
rules: {
31+
"jsdoc/require-jsdoc": "off",
32+
"jsdoc/require-param": "off",
33+
"jsdoc/require-returns": "off",
34+
},
35+
},
36+
]);

0 commit comments

Comments
 (0)