Skip to content

Commit

Permalink
Add github actions, remove travis (#65)
Browse files Browse the repository at this point in the history
- remove travis integration
- add github actions
- migrate to ghcr.io registry
  • Loading branch information
EugenMayer authored Sep 7, 2022
1 parent af9fae6 commit 53addfa
Show file tree
Hide file tree
Showing 8 changed files with 132 additions and 24 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/docker-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: docker pr

on:
push:
branches-ignore:
- "main"

env:
IMAGE_FQDN: ghcr.io/eugenmayer/kontextwork-converter

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# push only on main
- name: Build production
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
target: production
push: false
tags: |
${{ env.IMAGE_FQDN }}:latest
- name: Build dev
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
target: development
push: false
tags: |
${{ env.IMAGE_FQDN }}:latest
37 changes: 37 additions & 0 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: docker publish

on:
push:
tags:
- '*'

env:
IMAGE_FQDN: ghcr.io/eugenmayer/kontextwork-converter

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to GHCR
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ github.token }}
# push only on main
- name: Build and publish
uses: docker/build-push-action@v3
with:
context: .
platforms: linux/amd64
push: true
tags: |
${{ env.IMAGE_FQDN }}:${{ github.ref_name }}
build-args: |
VERSION=${{ github.ref_name }}
44 changes: 44 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: tests

on: push

env:
IMAGE_FQDN: ghcr.io/eugenmayer/kontextwork-converter

jobs:
tests:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install xmllint
run: sudo apt update && sudo apt-get install -y libreoffice
- name: Set up JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'adopt'
- name: Build
uses: gradle/gradle-build-action@v2
with:
arguments: build
- name: Unit Tests
uses: gradle/gradle-build-action@v2
with:
arguments: unitTest
- name: IT Tests
uses: gradle/gradle-build-action@v2
with:
arguments: itTests
- name: E2E Tests
uses: gradle/gradle-build-action@v2
with:
arguments: e2eTests
- name: Report
uses: dorny/[email protected]
if: always()
with:
name: Maven Tests
path: "**/test-results/**/TEST*.xml"
reporter: java-junit
fail-on-error: false
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
[![Build Status](https://travis-ci.org/EugenMayer/officeconverter.svg?branch=master)](https://travis-ci.org/EugenMayer/officeconverter)

## WAT

Offers a (i think production ready) REST service to convert files like PDF, docx,xlx .. odt .. you get it.. to other formats like pdf, png, doc, pdt, html.
This project is basically an extended version of [jodconverter-sample-rest](https://github.com/sbraconnier/jodconverter/tree/master/jodconverter-samples/jodconverter-sample-rest)

You can use this project as is using docker with `eugenmayer/kontextwork-converter` or build it here yourself.
You can use this project as is using docker with `ghcr.io/eugenmayer/kontextwork-converter` or build it here yourself.

## Build

Expand All @@ -24,7 +23,7 @@ or better use the docker image with everything included, no dev tools/LO needed
make start-prod

# alternativly
docker run --memory 512m --name converter-prod --rm -p 8080:8080 eugenmayer/kontextwork-converter:production
docker run --memory 512m --name converter-prod --rm -p 8080:8080 ghcr.io/eugenmayer/kontextwork-converter:production

You can now connect to the 5001 remote debugger port, just use the existing IntelliJ task if you like

Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ plugins {

// much better output during running tests
// see https://github.com/radarsh/gradle-test-logger-plugin for configuration options
id "com.adarshr.test-logger" version "3.1.0"
id "com.adarshr.test-logger" version "3.2.0"

// @see https://plugins.gradle.org/plugin/org.sonarqube
id "org.sonarqube" version "3.3"
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
org.gradle.caching=true
#org.gradle.parallel=true
#org.gradle.unsafe.configuration-cache=true
org.gradle.unsafe.configuration-cache=true
2 changes: 2 additions & 0 deletions gradle/tests.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ task e2eTests(type: Test) {
}

tasks.withType(Test).configureEach {
reports.junitXml.enabled = true

if (project.hasProperty('debug')) {
jvmArgs = ["-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=*:5007"]
}
Expand Down

0 comments on commit 53addfa

Please sign in to comment.