Skip to content

Commit

Permalink
Merge pull request #624 from apache/fix_workflows_in_main
Browse files Browse the repository at this point in the history
Fix workflows in main.
  • Loading branch information
leerho authored Jan 2, 2025
2 parents a92e7be + 763c58a commit 7dfbf54
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 163 deletions.
100 changes: 52 additions & 48 deletions .github/workflows/auto-jdk-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,71 @@
name: DataSketches-Java Auto JDK Matrix Test & Install

on:
pull_request:
push:
branches: [ master, main ]
workflow_dispatch:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
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
118 changes: 61 additions & 57 deletions .github/workflows/auto-os-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,81 @@
name: DataSketches-Java Auto OS Matrix Test & Install

on:
pull_request:
push:
branches: [ master, main ]
workflow_dispatch:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
workflow_dispatch:

env:
MAVEN_OPTS: -Xmx1g -Xms1g
MAVEN_OPTS: -Xmx4g -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
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ name: Serialization Compatibility Test

on:
push:
branches: [ master, main ]
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
workflow_dispatch:

jobs:
Expand Down
83 changes: 83 additions & 0 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
name: "CodeQL"

on:
push:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
pull_request:
paths-ignore: [ '**/*.html', '**/*.md', '**/*.txt', '**/*.xml', '**/*.yaml', '**/*.yml', '**/.*', '**/LICENSE', '**/NOTICE' ]
# The branches below must be a subset of the branches above
branches: [ 'main', '[0-9]+.[0-9]+.[Xx]' ]
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

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
cache: 'maven'
java-version: '17'

- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
queries: +security-and-quality

# 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 link below.

- name: Custom building using maven
run: >
mvn clean package -f "pom.xml" -B -V -e
-Dfindbugs.skip=true
-Dcheckstyle.skip=true
-Dpmd.skip=true
-Denforcer.skip
-Dmaven.javadoc.skip
-DskipTests=true
-Dmaven.test.skip.exec
-Dlicense.skip=true
-Dweb.console.skip=true
-Dgpg.skip=true
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"


# CodeQL's Query Packs:
# 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

# 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

# Architecture options: x86, x64, armv7, aarch64, ppc64le
# Lifecycles: validate, compile, test, package, verify, install, deploy
# -B batch mode, never stops for user input
# -V show Version without stopping
# -X debug mode
# -q quiet, only show errors
# -e produce execution error messages
File renamed without changes.
Loading

0 comments on commit 7dfbf54

Please sign in to comment.