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

Prevent GitHub Actions from being triggered twice #2559

Merged
merged 6 commits into from
Dec 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/actions/maven-build/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Maven Build
description: Run a Maven Build

inputs:
run-tests:
description: Whether or not to run tests. The default is true.
required: false
type: boolean
default: true

runs:
using: "composite"
steps:
- name: Set up JDK 11 for x64
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'temurin'
architecture: x64
cache: maven
- name: Build with Maven
shell: bash
run: mvn -B -U clean package${{ inputs.run-tests && '' || ' -DskipTests' }}
9 changes: 2 additions & 7 deletions .github/workflows/cve-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,9 @@ jobs:

steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
- uses: ./.github/actions/maven-build
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
run: mvn clean install -DskipTests
run-tests: false
- name: CVE scanning
uses: dependency-check/Dependency-Check_Action@1.1.0
env:
Expand Down
17 changes: 9 additions & 8 deletions .github/workflows/license-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,12 @@ name: License Scanning for Maven
on:
workflow_dispatch:
push:
branches:
- master
paths:
- 'pom.xml'
- '.github/workflows/license-scanning.yml'
pull_request:
paths:
- 'pom.xml'
- '.github/workflows/license-scanning.yml'
Expand All @@ -19,16 +25,11 @@ jobs:
module-folder: ["./", "./examples", "./rosetta-source", "./rosetta-project", "./distribution"]
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: 11
cache: maven
distribution: 'adopt'
- name: Install XQ
run: pip install xq
- name: Build with Maven
run: mvn clean install -DskipTests
- uses: ./.github/actions/maven-build
with:
run-tests: false
- name: License XML report
run: mvn org.codehaus.mojo:license-maven-plugin:2.0.0:download-licenses
- name: Validate XML report
Expand Down
13 changes: 4 additions & 9 deletions .github/workflows/windows-build.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
name: CDM Build on Windows machine

on: [workflow_dispatch, push, pull_request]
on:
workflow_dispatch:
pull_request:

jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Maven install
run: mvn install
- uses: ./.github/actions/maven-build