Skip to content

Commit 5cb9fa3

Browse files
committed
Update pr and master workflows
1 parent bab2c5d commit 5cb9fa3

File tree

10 files changed

+396
-229
lines changed

10 files changed

+396
-229
lines changed

.github/.java-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
21

.github/workflows/build.yml

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

.github/workflows/codeql.yml

Lines changed: 56 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
# For most projects, this workflow file will not need changing; you simply need
23
# to commit it to your repository.
34
#
@@ -12,10 +13,13 @@
1213
name: "CodeQL"
1314

1415
on:
15-
push:
16-
branches: [ "master" ]
1716
pull_request:
18-
branches: [ "master" ]
17+
branches: ["master"]
18+
merge_group:
19+
20+
concurrency:
21+
group: "${{ github.workflow }} @ ${{ github.event.pull_request.head.label || github.head_ref || github.ref }}"
22+
cancel-in-progress: true
1923

2024
jobs:
2125
analyze:
@@ -39,58 +43,58 @@ jobs:
3943
fail-fast: false
4044
matrix:
4145
include:
42-
- language: java-kotlin
43-
build-mode: autobuild
44-
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
45-
# Use `c-cpp` to analyze code written in C, C++ or both
46-
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
47-
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
48-
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
49-
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
50-
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
51-
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
46+
- language: java-kotlin
47+
build-mode: autobuild
48+
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
49+
# Use `c-cpp` to analyze code written in C, C++ or both
50+
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
51+
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
52+
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
53+
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
54+
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
55+
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
5256
steps:
53-
- name: Checkout repository
54-
uses: actions/checkout@v4
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
5559

56-
# Initializes the CodeQL tools for scanning.
57-
- name: Initialize CodeQL
58-
uses: github/codeql-action/init@v3
59-
with:
60-
languages: ${{ matrix.language }}
61-
build-mode: ${{ matrix.build-mode }}
62-
# If you wish to specify custom queries, you can do so here or in a config file.
63-
# By default, queries listed here will override any specified in a config file.
64-
# Prefix the list here with "+" to use these queries and those in the config file.
60+
# Initializes the CodeQL tools for scanning.
61+
- name: Initialize CodeQL
62+
uses: github/codeql-action/init@v3
63+
with:
64+
languages: ${{ matrix.language }}
65+
build-mode: ${{ matrix.build-mode }}
66+
# If you wish to specify custom queries, you can do so here or in a config file.
67+
# By default, queries listed here will override any specified in a config file.
68+
# Prefix the list here with "+" to use these queries and those in the config file.
6569

66-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
67-
# queries: security-extended,security-and-quality
70+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
71+
# queries: security-extended,security-and-quality
6872

69-
# If the analyze step fails for one of the languages you are analyzing with
70-
# "We were unable to automatically build your code", modify the matrix above
71-
# to set the build mode to "manual" for that language. Then modify this step
72-
# to build your code.
73-
# ℹ️ Command-line programs to run using the OS shell.
74-
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
75-
- if: matrix.build-mode == 'manual'
76-
run: |
77-
echo 'If you are using a "manual" build mode for one or more of the' \
78-
'languages you are analyzing, replace this with the commands to build' \
79-
'your code, for example:'
80-
echo ' make bootstrap'
81-
echo ' make release'
82-
exit 1
73+
# If the analyze step fails for one of the languages you are analyzing with
74+
# "We were unable to automatically build your code", modify the matrix above
75+
# to set the build mode to "manual" for that language. Then modify this step
76+
# to build your code.
77+
# ℹ️ Command-line programs to run using the OS shell.
78+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
79+
- if: matrix.build-mode == 'manual'
80+
run: |
81+
echo 'If you are using a "manual" build mode for one or more of the' \
82+
'languages you are analyzing, replace this with the commands to build' \
83+
'your code, for example:'
84+
echo ' make bootstrap'
85+
echo ' make release'
86+
exit 1
8387
84-
# In codeql-cli 2.17.6, they're recognising the configuration in the root build.gradle.kts file to compile against Java 8.
85-
# The best way to override this is to use a setup-java step to install the JDK version that your project requires.
86-
# Ref: https://github.com/github/codeql-action/issues/2360#issuecomment-2199969007
87-
- name: Set up JDK
88-
uses: actions/setup-java@v4
89-
with:
90-
java-version: 17
91-
distribution: 'temurin'
88+
# In codeql-cli 2.17.6, they're recognising the configuration in the root build.gradle.kts file to compile against Java 8.
89+
# The best way to override this is to use a setup-java step to install the JDK version that your project requires.
90+
# Ref: https://github.com/github/codeql-action/issues/2360#issuecomment-2199969007
91+
- name: Set up JDK
92+
uses: actions/setup-java@v4
93+
with:
94+
java-version: 17
95+
distribution: 'temurin'
9296

93-
- name: Perform CodeQL Analysis
94-
uses: github/codeql-action/analyze@v3
95-
with:
96-
category: "/language:${{matrix.language}}"
97+
- name: Perform CodeQL Analysis
98+
uses: github/codeql-action/analyze@v3
99+
with:
100+
category: "/language:${{matrix.language}}"

.github/workflows/docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
name: Deploy Docs
2+
name: docs
33

44
on:
55
workflow_dispatch:

.github/workflows/master.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
---
2+
name: master
3+
4+
on:
5+
push:
6+
paths-ignore:
7+
- 'docs/**'
8+
- '*.md'
9+
branches:
10+
- master
11+
12+
concurrency:
13+
group: '${{ github.workflow }}'
14+
# don't leave snapshot builds in a half-done state
15+
cancel-in-progress: false
16+
17+
jobs:
18+
validate-api:
19+
name: Validate API
20+
if: github.repository == 'serpro69/kotlin-faker'
21+
uses: ./.github/workflows/run_gradle.yml
22+
secrets: inherit
23+
with:
24+
runs-on: ubuntu-latest
25+
ref: ${{ inputs.ref }}
26+
task: apiCheck
27+
28+
build-primary:
29+
needs: validate-api
30+
strategy:
31+
matrix:
32+
include:
33+
# KMP
34+
- os: ubuntu-latest
35+
args: -P"kotlinFaker_enabledPublicationNamePrefixes=KotlinMultiplatform"
36+
# JVM
37+
- os: ubuntu-latest
38+
args: -P"kotlinFaker_enabledPublicationNamePrefixes=jvm"
39+
uses: ./.github/workflows/run_gradle.yml
40+
secrets: inherit
41+
with:
42+
ref: ${{ inputs.ref }}
43+
task: >
44+
-P"kotlinFaker_enableKotlinJs=true"
45+
-P"kotlinFaker_enableKotlinNative=true"
46+
${{ matrix.args }}
47+
--no-configuration-cache
48+
check publishToAppropriateCentralRepository
49+
runs-on: ${{ matrix.os }}

0 commit comments

Comments
 (0)