Skip to content

Commit

Permalink
Merge branch 'master' into addBukacekTest
Browse files Browse the repository at this point in the history
  • Loading branch information
asmfstatoil authored Sep 26, 2024
2 parents 429d3e9 + e886d6e commit 9615c5e
Show file tree
Hide file tree
Showing 739 changed files with 28,572 additions and 15,696 deletions.
83 changes: 36 additions & 47 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,51 +15,40 @@
"NODE_VERSION": "lts/*"
}
},

// Set *default* container specific settings.json values on container create.
//"settings": {
// "java.home": "/docker-java-home"
//},
"settings": {
"java.configuration.updateBuildConfiguration": "interactive",
"[java]": {
"editor.defaultFormatter": "redhat.java",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
},
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
"java.saveActions.organizeImports": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"java.checkstyle.version": "10.3",
"java.checkstyle.configuration": "${workspaceFolder}/checkstyle_neqsim.xml",
},


// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack",
"ms-vscode.test-adapter-converter",
"shengchen.vscode-checkstyle",
"mechatroner.rainbow-csv",
"redhat.vscode-xml",
"eamodio.gitlens"
]


// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Use 'postCreateCommand' to run commands after the container is created.
//"postCreateCommand": "mvn package",

// Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root.
//"remoteUser": "vscode",
//"features": {
// "github-cli": "latest"
//}
}

"customizations": {
"vscode": {
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"vscjava.vscode-java-pack",
"ms-vscode.test-adapter-converter",
"shengchen.vscode-checkstyle",
"mechatroner.rainbow-csv",
"redhat.vscode-xml",
"vscjava.vscode-java-test"
],
"settings": {
"java.configuration.updateBuildConfiguration": "interactive",
"[java]": {
"editor.defaultFormatter": "redhat.java",
"editor.formatOnSave": true,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": false
},
"java.format.settings.url": "https://raw.githubusercontent.com/google/styleguide/gh-pages/eclipse-java-google-style.xml",
"java.saveActions.organizeImports": true,
"java.checkstyle.version": "10.18.1",
"java.checkstyle.configuration": "${workspaceFolder}/checkstyle_neqsim.xml",
"[xml]": {
"editor.tabSize": 4,
"editor.insertSpaces": false
},
"[json]": {
"editor.tabSize": 4,
"editor.insertSpaces": true
}
}
}
}
}
28 changes: 28 additions & 0 deletions .github/workflows/maven_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Publish package to the Maven Central Repository
on:
workflow_dispatch:
release:
types: [published]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }}
gpg-passphrase: MAVEN_GPG_PASSPHRASE
- name: Set version
run: mvn versions:set -DnewVersion=${{ github.event.release.tag_name }}
- name: Publish package
run: mvn -P release --batch-mode deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_SIGNING_KEY_PASSWORD }}
21 changes: 21 additions & 0 deletions .github/workflows/publish_javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Deploy Javadoc

on:
workflow_dispatch:
release:
types: [published]

jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write # if you have a protection rule on your repository, you'll need to give write permission to the workflow.
steps:
- name: Deploy JavaDoc 🚀
uses: MathieuSoysal/[email protected]
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
javadoc-branch: javadoc
java-version: 17
target-folder: javadoc # url will be https://equinor.github.io/neqsim/javadoc
project: maven
4 changes: 2 additions & 2 deletions .github/workflows/release_to_github_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3.6.0
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'temurin'
Expand Down
93 changes: 48 additions & 45 deletions .github/workflows/release_with_jars.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
name: Create release (draft)
# Workflow is triggered when any pom-file is updated in master-branch
# If both pom-files have the same version number it
# - builds NeqSim-jars both in Java 8 and Java 11
# - creates a new release and uploads the jars as artifacts
# - makes a new branch in neqsimpython and updates the jar-files used there.

on:
workflow_dispatch:
Expand All @@ -26,7 +21,7 @@ jobs:

steps:
- name: Check out neqsim java project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Get version number for pomJava8.xml
id: java-8
uses: JActions/[email protected]
Expand All @@ -50,9 +45,9 @@ jobs:

steps:
- name: Check out neqsim java project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK 8 environment
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
Expand All @@ -61,9 +56,9 @@ jobs:
run: mvn -B package --file pomJava8.xml
- name: Copy jar file to staging
run: mkdir staging && cp target/neqsim*Java8.jar staging
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: jarfiles
name: jarfiles-java8
path: staging

compile_java_11:
Expand All @@ -75,9 +70,9 @@ jobs:

steps:
- name: Check out neqsim java project
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Set up JDK 11 environment
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
Expand All @@ -86,21 +81,56 @@ jobs:
run: mvn -B package --file pom.xml
- name: Copy jar file to staging
run: mkdir staging && cp target/neqsim*.jar staging
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v3
with:
name: jarfiles
name: jarfiles-java11
path: staging


compile_java_21:
name: Build Neqsim ${{ needs.get_versions.outputs.version }} with java 21
needs: get_versions

if: ${{ needs.get_versions.outputs.version_8 == needs.get_versions.outputs.version }}
runs-on: ubuntu-latest

steps:
- name: Check out neqsim java project
uses: actions/checkout@v4
- name: Set up JDK 21 environment
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Build java 21 version with Maven
run: mvn -B package --file pomJava21.xml
- name: Rename files
run: cd target && find . -type f -name "neqsim-*.jar" -exec sh -c 'mv -f $0 ${0%.jar}-Java21.jar' {} \; && cd ..
- name: Copy jar file to staging
run: mkdir staging && cp target/neqsim*Java21.jar staging
- uses: actions/upload-artifact@v3
with:
name: jarfiles-java21
path: staging

create_release:
name: Create release v${{ needs.get_versions.outputs.version_8 }}
runs-on: ubuntu-latest
needs: [get_versions, compile_java_8, compile_java_11]
needs: [get_versions, compile_java_8, compile_java_11, compile_java_21]

steps:
- name: Download jar files from artifacts
- name: Download java 8 jar files
uses: actions/[email protected]
with:
name: jarfiles
name: jarfiles-java8
- name: Download java 11 jar files
uses: actions/[email protected]
with:
name: jarfiles-java11
- name: Download java 21 jar files
uses: actions/[email protected]
with:
name: jarfiles-java21

- name: Create release v${{ needs.get_versions.outputs.version_8 }}
uses: ncipollo/[email protected]
Expand All @@ -110,32 +140,5 @@ jobs:
draft: true
generateReleaseNotes: true
skipIfReleaseExists: true
artifactErrorsFailBuild: true
artifacts: "*.jar"
artifactContentType: application/java-archive

# # Needs to delete the old jars manually
# - run: mkdir lib && cp *.jar lib/
# - run: cd lib && mkdir libj8 && mv *Java8.jar libj8/ && cd ..

# - name: Create release branch in neqsimpython repo
# uses: GuillaumeFalourd/[email protected]
# with:
# repository_owner: Equinor
# repository_name: neqsimpython
# new_branch_name: NeqSim-jars-updated-${{ needs.get_versions.outputs.version_8 }}
# ssh_deploy_key: ${{ secrets.SSH_DEPLOY_KEY }}

# - name: Push directory to another repository
# uses: cpina/[email protected]
# env:
# SSH_DEPLOY_KEY: ${{ secrets.SSH_DEPLOY_KEY }}
# with:
# source-directory: 'lib'
# destination-github-username: 'equinor'
# destination-repository-name: 'neqsimpython'
# user-email: [email protected]
# target-branch: NeqSim-jars-updated-${{ needs.get_versions.outputs.version_8 }}
# target-directory: neqsim/lib
# commit_message: 'chore: updated jar-files'

35 changes: 26 additions & 9 deletions .github/workflows/verify_build.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Assert package builds, tests run and javadoc builds
name: Run build, test and javadoc

on:
workflow_dispatch:
Expand All @@ -11,13 +11,13 @@ on:
- master

jobs:
test_javadoc:
test_java_11:
name: Assert tests and javadoc with java 11
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
Expand All @@ -29,25 +29,42 @@ jobs:
- name: Create coverage report from jacoco execution data
run: mvn -B jacoco:report -ntp
- name: Upload jacoco coverage reports to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
file: jacoco.xml
name: codecov
token: ${{ secrets.CODECOV_TOKEN }}
# tags: coverage

test_java_8:
name: Assert tests and javadoc with java 8
name: Assert tests with java 8
runs-on: ubuntu-latest
needs: test_javadoc
needs: test_java_11

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up JDK 8
uses: actions/setup-java@v3
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '8'
cache: 'maven'
- name: Run tests
run: mvn -B test --file pomJava8.xml -ntp


test_java_21:
name: Assert tests with java 21
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
cache: 'maven'
- name: Generate javadoc
run: mvn javadoc:javadoc
- name: Run tests
run: mvn -B test --file pomJava21.xml -ntp
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,6 @@ test_*.ser
html/
latex/
eclipse_dictionary.txt

src/main/**/*.png
src/main/**/*.gif
Loading

0 comments on commit 9615c5e

Please sign in to comment.