Skip to content

Commit

Permalink
Merge pull request #8 from JonasSchaub/functional-repo
Browse files Browse the repository at this point in the history
Making the repository functional
  • Loading branch information
JonasSchaub authored Dec 15, 2023
2 parents 42d6ce1 + e0da3a6 commit 27f62a4
Show file tree
Hide file tree
Showing 39 changed files with 2,402 additions and 92,222 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/SonarCloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# source: SonarCloud setup tutorial

name: SonarCloud
on:
push:
branches:
- master
- functional-repo
pull_request:
types: [opened, synchronize, reopened]
jobs:
build:
name: Build and analyze
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # Shallow clones should be disabled for a better relevancy of analysis
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: 21
distribution: 'temurin' # Alternative distribution options are available, e.g. zulu
- name: Cache SonarCloud packages
uses: actions/cache@v3
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Cache Gradle packages
uses: actions/cache@v3
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
restore-keys: ${{ runner.os }}-gradle
- name: Build and analyze
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Needed to get PR information, if any
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
run: ./gradlew build sonar --info
36 changes: 36 additions & 0 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
push:
branches: [ "main", "functional-repo" ]
pull_request:
branches: [ "main" ]

permissions:
contents: read

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Build with Gradle
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
25 changes: 25 additions & 0 deletions .github/workflows/publish-javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Deploy Javadoc

#Note: The Javadoc-publisher action only commits to javadoc branch and triggers the GitHub pages update action if there
# are changes in the JavaDoc, i.e. it ignores the Readme.md that is used as main landing page of the GitHub pages!
# And these need to be merged into the javadoc branch.

on:
release:
types: [published] #alternatives: released, published, created
#push:
#branches:
#- main

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
javadoc-branch: javadoc
java-version: 21
target-folder: javadoc/1.2
project: gradle
46 changes: 46 additions & 0 deletions .github/workflows/publish-to-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

# GitHub recommends pinning actions to a commit SHA.
# To get a newer version, you will need to update the SHA.
# You can also reference a tag or branch, but the action may change without warning.

#taken from: https://docs.github.com/en/actions/publishing-packages/publishing-java-packages-with-gradle
# and extended using https://selectfrom.dev/using-github-actions-to-automatically-publish-gradle-build-artifacts-d71c915cfa4
name: Publish package to the Maven Central Repository
on:
#push:
#branches: [ "main" ]
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Java
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Change wrapper permissions
run: chmod +x ./gradlew
- name: Validate Gradle wrapper
uses: gradle/wrapper-validation-action@ccb4328a959376b642e027874838f60f8e596de3
#- name: Publish package
#uses: gradle/gradle-build-action@749f47bda3e44aa060e82d7b3ef7e40d953bd629 #from the tutorial
##uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1 #this is the action used in the other yml file, the Gradle build
#with:
#arguments: publish
#env:
#MAVEN_USERNAME: ${{ secrets.OSSRHUSERNAME }}
#MAVEN_PASSWORD: ${{ secrets.OSSRHPASSWORD }}
- name: Publish with Gradle #from the second tutorial
env:
MAVEN_PASSWORD: ${{secrets.OSSRHPASSWORD}}
MAVEN_USERNAME: ${{secrets.OSSRHUSERNAME}}
signingKey: ${{secrets.PGP_SECRET}}
signingPassword: ${{secrets.PGP_PASSPHRASE}}
run: ./gradlew publish --no-daemon
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,10 @@
# Idea files and folders #
.idea/
*iml
target/

# Gradle build dir
build/
.gradle

# EFGF evaluation test output
ErtlFunctionalGroupsFinderEvaluationTest_Output/
20 changes: 0 additions & 20 deletions Basic/Basic usage instructions.txt

This file was deleted.

Loading

0 comments on commit 27f62a4

Please sign in to comment.