Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix indentations in all workflows and try to fix CodeQL #621

Merged
merged 10 commits into from
Dec 19, 2024
5 changes: 3 additions & 2 deletions .github/workflows/auto-check_cpp_files.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
name: Serialization Compatibility Test
name: Auto C++ Serialization Compatibility Test

on:
pull_request:
push:
branches: [ master, main ]
branches: [ 7.0.X ]
workflow_dispatch:

jobs:
Expand Down
98 changes: 49 additions & 49 deletions .github/workflows/auto-jdk-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
name: DataSketches-Java Auto JDK Matrix Test & Install
name: Auto JDK Matrix Test, Install

on:
pull_request:
push:
branches: [ master, main ]
workflow_dispatch:
pull_request:
push:
branches: [ 7.0.X ]
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx4g -Xms1g
MAVEN_OPTS: -Xmx4g -Xms1g

jobs:
build:
name: Build, Test, Install
runs-on: ubuntu-latest
build:
name: Build, Test, Install
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
jdk: [ 17 ]
strategy:
fail-fast: false
matrix:
jdk: [ 17 ]

env:
JDK_VERSION: ${{ matrix.jdk }}
env:
JDK_VERSION: ${{ matrix.jdk }}

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Print Current workflow
run: >
cat .github/workflows/auto-jdk-matrix.yml
- name: Print Current workflow
run: >
cat .github/workflows/auto-jdk-matrix.yml

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install Matrix JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64
- name: Install Matrix JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64

- name: Echo Java Version
run: >
java -version
- name: Echo Java Version
run: >
java -version

- name: Test
run: >
mvn clean test -B
-Dmaven.javadoc.skip=true
-Dgpg.skip=true
- name: Test
run: >
mvn clean test -B
-Dmaven.javadoc.skip=true
-Dgpg.skip=true

- name: Install
run: >
mvn clean install -B
-DskipTests=true
-Dgpg.skip=true
- name: Install
run: >
mvn clean install -B
-DskipTests=true
-Dgpg.skip=true

# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
Expand Down
116 changes: 58 additions & 58 deletions .github/workflows/auto-os-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
name: DataSketches-Java Auto OS Matrix Test & Install
name: Auto OS Matrix Test, Install

on:
pull_request:
push:
branches: [ master, main ]
workflow_dispatch:
pull_request:
push:
branches: [ 7.0.X ]
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx1g -Xms1g
MAVEN_OPTS: -Xmx1g -Xms1g

jobs:
build:
name: Build, Test, Install
build:
name: Build, Test, Install

strategy:
fail-fast: false
strategy:
fail-fast: false

matrix:
jdk: [ 17 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
include:
- os: windows-latest
skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
skip_gpg: "`-Dgpg`.skip=true"
- os: ubuntu-latest
skip_javadoc: -Dmaven.javadoc.skip=true
skip_gpg: -Dgpg.skip=true
- os: macos-latest
skip_javadoc: -Dmaven.javadoc.skip=true
skip_gpg: -Dgpg.skip=true
matrix:
jdk: [ 17 ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
include:
- os: windows-latest
skip_javadoc: "`-Dmaven`.javadoc`.skip=true"
skip_gpg: "`-Dgpg`.skip=true"
- os: ubuntu-latest
skip_javadoc: -Dmaven.javadoc.skip=true
skip_gpg: -Dgpg.skip=true
- os: macos-latest
skip_javadoc: -Dmaven.javadoc.skip=true
skip_gpg: -Dgpg.skip=true

runs-on: ${{matrix.os}}
runs-on: ${{matrix.os}}

env:
JDK_VERSION: ${{ matrix.jdk }}
env:
JDK_VERSION: ${{ matrix.jdk }}

steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false
steps:
- name: "Checkout ${{ github.ref }} ( ${{ github.sha }} )"
uses: actions/checkout@v4
with:
persist-credentials: false

- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: build-${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: build-${{ runner.os }}-maven-

- name: Install Matrix JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64
- name: Install Matrix JDK
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.jdk }}
distribution: 'temurin'
java-package: jdk
architecture: x64

- name: Echo Java Version
run: >
java -version
- name: Echo Java Version
run: >
java -version

- name: Test
run: >
mvn clean test
${{matrix.os.skip_javadoc}}
${{matrix.os.skip_gpg}}
- name: Test
run: >
mvn clean test
${{matrix.os.skip_javadoc}}
${{matrix.os.skip_gpg}}

- name: Install
run: >
mvn clean install -B
${{matrix.os.skip_javadoc}}
-D skipTests=true
${{matrix.os.skip_gpg}}
- name: Install
run: >
mvn clean install -B
${{matrix.os.skip_javadoc}}
-D skipTests=true
${{matrix.os.skip_gpg}}

# Architecture options: x86, x64, armv7, aarch64, ppc64le
# setup-java@v4 has a "with cache" option
Expand Down
78 changes: 78 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: "CodeQL"

on:
push:
branches:
- '7.0.X'
- 'main'
pull_request_target:
types:
- opened
branches:
- '7.0.X'
- 'main'
workflow_dispatch:

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: [ 'java' ]
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
# Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support

steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# 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
queries: +security-and-quality


# Autobuild attempts to build any compiled languages (C/C++, C#, Go, or Java).
# If this step fails, then you should remove it and run the build manually (see below)

# -name: Autobuild
# uses: github/codeql-action/autobuild@v3

# Command-line programs to run using the OS shell.
# See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun

# If the Autobuild fails above, remove it and uncomment the following three lines.
# modify them (or add more) to build your code if your project, please refer to the EXAMPLE below for guidance.

# - run: |
# echo "Run, Build Application using script"
# ./location_of_script_within_repo/buildscript.sh

# Note: Autobuild fails thus the following manual build
- name: Manual Build With Java 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'

- name: Java Compile
run: mvn clean compile

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
Loading
Loading