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

Updates tests #14

Merged
merged 1 commit into from
Oct 22, 2024
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: 0 additions & 23 deletions .github/workflows/cron.yml

This file was deleted.

98 changes: 62 additions & 36 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: CI
name: K2hash Java CI

on:
# Trigger the workflow on push or pull request,
Expand All @@ -19,41 +19,67 @@ jobs:
build:

if: "! contains(toJSON(github.event.commits.*.message), '[skip ci]') && ! contains(toJSON(github.event.commits.*.message), '[ci skip]')"

runs-on: ubuntu-latest
strategy:
matrix:
java: [ '8', '11', '17', '21' ]

name: Java ${{ matrix.java }}
steps:
- uses: actions/checkout@v2
- name: Setup Java JDK
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'adopt'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable of GPG private key passphrase

- name: Install dependent packages, build package and run tests
run: mvn -B clean exec:exec package

- name: Upload a jar file to asset
if: github.event_name == 'release'
run: mvn -B exec:exec -Pupload
env:
GITHUB_TOKEN: ${{ github.token }}

- name: Deploy the docs to github
if: github.event_name == 'release'
run: mvn -B site -s settings_github.xml
env:
GITPAGES_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKE_FOR_GITPAGES }}

- name: Publish to Apache Maven Central
if: github.event_name == 'release'
run: mvn -B deploy -Prelease -s $GITHUB_WORKSPACE/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
- uses: actions/checkout@v4
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
server-id: ossrh
settings-path: ${{ github.workspace }}
server-username: OSSRH_USERNAME
server-password: OSSRH_PASSWORD
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }} # Value of the GPG private key to import
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable of GPG private key passphrase

- name: Set environments
run: |
echo "COMMON_MAVEN_OPTS=-Dmaven.compiler.failOnWarning=true -Dmaven.compiler.showDeprecation=true -Dmaven.compiler.verbose=true -Dmaven.compiler.debuglevel=lines,vars,source" >> "$GITHUB_ENV"

- name: Install dependent packages
run: |
sudo apt-get install -y curl
curl -s https://packagecloud.io/install/repositories/antpickax/stable/script.deb.sh | sudo bash
sudo apt-get install -y k2hash-dev

- name: Run checkstyle
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} checkstyle:check

- name: Run package on version 8
if: "matrix.java == '8'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} -Dmaven.compiler.target=8 package

- name: Run package on version other than 8
if: "matrix.java != '8'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} -Dmaven.compiler.target=${{ matrix.java }} -Dmaven.compiler.source=${{ matrix.java }} -Dmaven.compiler.release=${{ matrix.java }} package

- name: Run javadoc
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} javadoc:javadoc

- name: Deploy the docs to github
if: "github.event_name == 'release' && matrix.java == '21'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} site -s settings_github.xml
env:
GITPAGES_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKE_FOR_GITPAGES }}

- name: Publish to Apache Maven Central
if: "github.event_name == 'release' && matrix.java == '21'"
run: |
mvn ${{ env.COMMON_MAVEN_OPTS }} deploy -Prelease -s $GITHUB_WORKSPACE/settings.xml
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_GPG_PASSPHRASE: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
139 changes: 0 additions & 139 deletions .github/workflows/upload.sh

This file was deleted.

109 changes: 108 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
# -*- mode: gitignore; -*-
#
# Emacs
#
*~
\#*\#
/.emacs.desktop
/.emacs.desktop.lock
*.elc
auto-save-list
tramp
.\#*

# Org-mode
.org-id-locations
*_archive

# flymake-mode
*_flymake.*

# eshell files
/eshell/history
/eshell/lastdir

# elpa packages
/elpa/

# reftex files
*.rel

# AUCTeX auto folder
/auto/

# cask packages
.cask/
dist/

# Flycheck
flycheck_*.el

# server auth directory
/server/

# projectiles files
.projectile

# directory configuration
.dir-locals.el

# network security
/network-security.data

#
# Java
#
# Compiled class file
*.class

Expand All @@ -13,11 +68,63 @@
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar

# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
/target/
replay_pid*

#
# Maven
#
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
# https://github.com/takari/maven-wrapper#usage-without-binary-jar
.mvn/wrapper/maven-wrapper.jar

# Eclipse m2e generated files
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath

#
# MacOS
#
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
Loading
Loading