Skip to content

Commit

Permalink
Version 2 — change implementation to be Kotlin/JVM based (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandru authored Oct 13, 2022
1 parent dfc08fa commit 6cbf414
Show file tree
Hide file tree
Showing 63 changed files with 3,631 additions and 1,002 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# https://docs.github.com/en/github/administering-a-repository/displaying-a-sponsor-button-in-your-repository

# I need to apply here: https://github.com/sponsors
# Maybe apply here: https://github.com/sponsors
# github: [alexandru]
patreon: alexelcu
40 changes: 19 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# 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.

name: build
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-20.04

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- uses: haskell/actions/setup@v1
with:
ghc-version: '8.10.7' # lts-18.21?
enable-stack: true
stack-version: 'latest'
- uses: actions/checkout@v3

- uses: actions/cache@v2
name: Cache ~/.stack
- name: Set up JDK
uses: actions/setup-java@v3
with:
key: ${{ runner.os }}-stack-${{ hashFiles('**/stack.yaml.lock') }}-${{ hashFiles('**/github-webhook-listener.cabal') }}
restore-keys: |
${{ runner.os }}-stack-
path: |
~/.stack
java-version: '17'
distribution: 'adopt'

- name: Resolve/Update Dependencies
run: |
stack --no-terminal setup
- name: Setup Gradle
uses: gradle/gradle-build-action@v2

- name: Run tests
run: |
stack --no-terminal test
- name: Run Tests
run: ./gradlew check
99 changes: 70 additions & 29 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,75 @@ on:
types: [released]

jobs:
deploy_docker:
runs-on: ubuntu-20.04
deploy_docker_jvm:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install Docker
run: |
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- name: Login to Docker
run: docker login ghcr.io --username=alexandru --password="$GH_TOKEN"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build JVM Docker image
run: |
make build-jvm
env:
GIT_TAG: ${{ github.ref }}

- name: Push JVM Docker images
run: |
make push-jvm
env:
GIT_TAG: ${{ github.ref }}

deploy_docker_native:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3

- name: Install Docker
run: |
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- name: Login to Docker
run: docker login ghcr.io --username=alexandru --password="$GH_TOKEN"
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Build Native Docker image
run: |
make build-native
env:
GIT_TAG: ${{ github.ref }}

- name: Push Native Docker images
run: |
make push-native
env:
GIT_TAG: ${{ github.ref }}

all:
name: Pushed All
if: always()
needs: [ deploy_docker_native, deploy_docker_jvm ]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master

- name: Install Docker
run: |
sudo apt-get remove docker docker-engine docker.io containerd runc
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
- name: Login to Docker
run: docker login --username=$DOCKER_USER --password=$DOCKER_PASS
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}

- name: Build Docker image
run: |
make build
env:
GIT_TAG: ${{ github.ref }}

- name: Push Docker image
run: |
make push
- name: Validate required tests
uses: re-actors/alls-green@release/v1
with:
jobs: ${{ toJSON(needs) }}
55 changes: 55 additions & 0 deletions .github/workflows/refreshVersions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Worfklow for https://jmfayard.github.io/refreshVersions/

name: RefreshVersions

on:
workflow_dispatch:
schedule:
- cron: '0 7 * * 1'

jobs:
"Refresh-Versions":
runs-on: "ubuntu-latest"
steps:
- id: step-0
name: check-out
uses: actions/checkout@v3
with:
ref: main
- id: step-1
name: setup-java
uses: actions/setup-java@v3
with:
java-version: 17
distribution: adopt
- id: step-2
name: create-branch
uses: peterjgrainger/action-create-branch@v2.2.0
with:
branch: dependency-update
env:
GITHUB_TOKEN: {{ secrets.GITHUB_TOKEN }}
- id: step-3
name: gradle refreshVersions
uses: gradle/gradle-build-action@v2
with:
arguments: refreshVersions
- id: step-4
name: Commit
uses: EndBug/add-and-commit@v9
with:
author_name: GitHub Actions
author_email: noreply@github.com
message: Refresh versions.properties
new_branch: dependency-update
push: --force --set-upstream origin dependency-update
- id: step-5
name: Pull Request
uses: repo-sync/pull-request@v2
with:
source_branch: dependency-update
destination_branch: main
pr_title: Upgrade gradle dependencies
pr_body: '[refreshVersions](https://github.com/jmfayard/refreshVersions) has found those library updates!'
pr_draft: true
github_token: {{ secrets.GITHUB_TOKEN }}
59 changes: 36 additions & 23 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,36 @@
dist
dist-*
cabal-dev
*.o
*.hi
*.chi
*.chs.h
*.dyn_o
*.dyn_hi
.hpc
.hsenv
.cabal-sandbox/
cabal.sandbox.config
*.prof
*.aux
*.hp
*.eventlog
.stack-work/
cabal.project.local
cabal.project.local~
.HTF/
.ghc.environment.*
.vscode/
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
3 changes: 3 additions & 0 deletions .sdkmanrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=22.2.r17-grl
3 changes: 0 additions & 3 deletions ChangeLog.md

This file was deleted.

28 changes: 0 additions & 28 deletions Dockerfile

This file was deleted.

6 changes: 0 additions & 6 deletions Dockerfile.fromCurrent

This file was deleted.

Loading

0 comments on commit 6cbf414

Please sign in to comment.