Skip to content

Commit

Permalink
chore: github ci and action improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jac18281828 committed Dec 24, 2024
1 parent 59f08bf commit 6c96a42
Show file tree
Hide file tree
Showing 6 changed files with 79 additions and 9 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,14 @@
name: Java CI with Maven

on:
push:
branches:
- master
pull_request:
branches:
- master

workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11', '14' ]
java: ['11', '14']
steps:
- uses: actions/checkout@v4.2.2
- name: Set up JDK ${{ matrix.java }}
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/commit-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: commitlint
on:
push:
pull_request:
workflow_dispatch:
jobs:
run-commitlint-on-pull-request:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 22.x
- name: Install dependencies
run: npm install -g @commitlint/{cli,config-conventional}
- name: Validate all commits from PR
run: npx commitlint --from HEAD~${{ github.event.pull_request.commits }} --to HEAD --verbose
22 changes: 22 additions & 0 deletions .github/workflows/yamlfmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Yamlfmt
on:
push:
pull_request:
workflow_dispatch:
jobs:
run-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22.4
- name: Install yamlfmt
run: |
go install github.com/google/yamlfmt/cmd/yamlfmt@latest
strip $(which yamlfmt)
- name: Run yamlfmt
run: yamlfmt -lint .github/*.yml .github/workflows/*.yml
29 changes: 28 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
# Stage 1: Build yamlfmt
FROM golang:1 AS go-builder
# defined from build kit
# DOCKER_BUILDKIT=1 docker build . -t ...
ARG TARGETARCH

# Install yamlfmt
WORKDIR /yamlfmt
RUN go install github.com/google/yamlfmt/cmd/yamlfmt@latest && \
strip $(which yamlfmt) && \
yamlfmt --version

# Stage 2: Build Java dev container
FROM jac18281828/javadev:latest

WORKDIR /build

ENV JAVA_HOME=/usr/lib/jvm/default-java

COPY . .

CMD mvn -U clean compile package && java -jar /build/target/benchmarks.jar

FROM jac18281828/javadev:latest

WORKDIR /build
Expand All @@ -7,4 +30,8 @@ ENV JAVA_HOME=/usr/lib/jvm/default-java
USER java
ENV USER=java

CMD mvn -U clean source:jar compile test verify package javadoc:jar
COPY --chown=${USER}:${USER} --from=go-builder /go/bin/yamlfmt /go/bin/yamlfmt
COPY --chown=${USER}:${USER} . .
ENV PATH=${PATH}:/go/bin

# mvn -U clean source:jar compile test verify package javadoc:jar
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ Disruptor is the highest performing intra-thread transfer mechanism available in
<caption><strong>2017 Conversant Disruptor - Still the World's Fastest</strong></caption>
</table>

# Getting Started
# Benchmark First!

Conversant Disruptor was designed to run on Intel Xeon hardware. For any other platform or
architecture always benchmark before using.

g# Getting Started

Run the maven build to build and use the package.

Expand Down
1 change: 1 addition & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = { extends: ['@commitlint/config-conventional'] };

0 comments on commit 6c96a42

Please sign in to comment.