Skip to content
This repository has been archived by the owner on Apr 9, 2021. It is now read-only.

Commit

Permalink
ci: refactor all ci
Browse files Browse the repository at this point in the history
Move from maven to gradle,
Add dependabot
Add automatic release
  • Loading branch information
Julien Bouyoud committed Jul 6, 2020
1 parent 8aa9b90 commit c499ede
Show file tree
Hide file tree
Showing 17 changed files with 458 additions and 245 deletions.
12 changes: 12 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 1
update_configs:
- package_manager: 'java:gradle'
directory: '/'
update_schedule: 'daily'
automerged_updates:
- match:
dependency_type: "development"
update_type: "all"
- match:
dependency_type: "production"
update_type: "semver:minor"
20 changes: 20 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]

# Change these settings to your own preference
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[Makefile]
indent_style = tab
3 changes: 3 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* @Leadformance/cuir-cuir-moustache
build.gradle @Leadformance/cuir-cuir-moustache @Leadformance/dependabot-approvers
gradle.properties @Leadformance/cuir-cuir-moustache @Leadformance/dependabot-approvers
11 changes: 11 additions & 0 deletions .github/workflows/auto-approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Dependabot PR
on: pull_request

jobs:
auto-approve:
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' || github.actor == 'dependabot-preview[bot]'
steps:
- uses: hmarr/[email protected]
with:
github-token: "${{ secrets.CI_GH_TOKEN }}"
66 changes: 66 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: CI
on:
push:
branches:
- master
pull_request:

jobs:
build:
runs-on: ubuntu-latest
if: "!contains(github.event.head_commit.message, '[skip ci]')"
steps:
- uses: actions/checkout@v1

- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12.x
registry-url: https://solocal.jfrog.io/solocal/api/npm/npm/
always-auth: true
scope: '@bridge'

- uses: actions/cache@v2
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Build
run: |
./gradlew build
- name: Test
run: |
mkdir build/docker
cd build/docker
cp ../libs/*.jar ./keycloak-protocol-cas.jar
echo "FROM quay.io/keycloak/keycloak:7.0.0" > Dockerfile
echo "ADD keycloak-protocol-cas.jar /opt/jboss/keycloak/standalone/deployments/" >> Dockerfile
docker build -t doccrazy/keycloak-cas .
cd -
docker run -d -p 127.0.0.1:8080:8080 --name keycloak -e KEYCLOAK_USER=admin -e KEYCLOAK_PASSWORD=admin doccrazy/keycloak-cas
sleep 60
docker logs keycloak &&
docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh config credentials --server http://localhost:8080/auth --realm master --user admin --password admin
docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh create clients -r master -s clientId=test -s protocol=cas -s enabled=true -s publicClient=true -s 'redirectUris=["http://localhost/*"]' -s baseUrl=http://localhost -s adminUrl=http://localhost
docker exec -t keycloak /opt/jboss/keycloak/bin/kcadm.sh get serverinfo -r master --fields "providers(login-protocol(providers(cas)))" | grep cas
integrationTest/suite.sh
- name: 'Release'
run: |
mkdir -p .github-assets/
cp build/libs/keycloak-plugin-auth-flow-recaptcha-*.jar .github-assets/keycloak-plugin-auth-flow-recaptcha.jar
npx -p @bridge/semantic-release-config gh-actions-bridge-semantic-release
env:
SEMVER_RELEASE_TYPE: KEYCLOAK_PLUGIN
ACTION_GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.CI_GH_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
9 changes: 3 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ nbproject
######################
*.log

# Maven #
# Gradle #
#########
target

# Maven shade
#############
*dependency-reduced-pom.xml
build/
.gradle/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@bridge:registry=https://solocal.jfrog.io/solocal/api/npm/npm/
always-auth = true
3 changes: 3 additions & 0 deletions .releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": "@bridge/semantic-release-config"
}
50 changes: 0 additions & 50 deletions .travis.yml

This file was deleted.

46 changes: 46 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
repositories {
jcenter()
}

apply plugin: 'idea'
apply plugin: 'java'
apply plugin: 'jacoco'

group 'corg.keycloak'
version '7.0.0'
description 'Keycloak CAS Protocol'

sourceCompatibility = 1.8

configurations {
testCompile.extendsFrom compileOnly
}

dependencies {
//keycloak
compileOnly "org.jboss.logging:jboss-logging:${project.property('jboss-logging-version')}"
compileOnly "org.jboss.logging:jboss-logging-annotations:${project.property('jboss.logging.tools.version')}"
compileOnly "org.jboss.logging:jboss-logging-processor:${project.property('jboss.logging.tools.version')}"
compileOnly "org.keycloak:keycloak-core:${project.property('keycloak-version')}"
compileOnly "org.keycloak:keycloak-saml-core:${project.property('keycloak-version')}"
compileOnly "org.keycloak:keycloak-services:${project.property('keycloak-version')}"
compileOnly "org.keycloak:keycloak-server-spi:${project.property('keycloak-version')}"
compileOnly "org.keycloak:keycloak-server-spi-private:${project.property('keycloak-version')}"

// Use JUnit test framework
testCompile 'junit:junit:4.13'
testCompile 'org.xmlunit:xmlunit-core:2.3.0'
testCompile 'com.jayway.jsonpath:json-path:2.2.0'
}

compileJava {
options.compilerArgs << '-AgeneratedTranslationFilesPath=dist/generated-translation-files'
}

jar {
manifest {
attributes(
"Dependencies": "javax.xml.bind.api,org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-server-spi-private,org.keycloak.keycloak-services,org.keycloak.keycloak-saml-core,org.keycloak.keycloak-saml-core-public",
)
}
}
4 changes: 4 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# 10.0.2
keycloak-version=7.0.0
jboss-logging-version=3.4.1.Final
jboss.logging.tools.version=2.1.0.Final
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit c499ede

Please sign in to comment.