Skip to content

Commit

Permalink
chore(): post mono repo migration
Browse files Browse the repository at this point in the history
  • Loading branch information
KarimGl committed Feb 23, 2024
1 parent 3bf22b4 commit 3989ad3
Show file tree
Hide file tree
Showing 128 changed files with 1,450 additions and 2,113 deletions.
1 change: 1 addition & 0 deletions chutney/.env.nix → .env.chutney.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ mkShell {

buildInputs = [
unstable.nodejs_20
unstable.act
chromium
geckodriver
jdk
Expand Down
23 changes: 23 additions & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Setup a working environment without hassle using nix and direnv
# For more information, visit https://direnv.net/

# Install node, npm and geckodriver by loading .env.chutney.nix expression
use_nix .env.chutney.nix

# Some tools (ex. Intellij) might need to configure paths to node, npm etc.
# You can use following symlinks provided in .env folder

## Create .env folder
[[ ! -d .env.chutney ]] && mkdir .env.chutney && echo "Create .env.chutney folder"

## Symlink npm home
ln -sfn $(dirname "$(dirname "$(readlink -f $(which npm))")") .env.chutney/npm_home && echo "Symlink npm home dir"

## Symlink JDK
ln -sfn $JAVA_HOME .env.chutney/jdk && echo "Symlink jdk \"$JAVA_HOME\""

## Symlink Node
ln -sfn $(readlink -f $(which node)) .env.chutney/node && echo "Symlink node \"$(readlink -f $(which node))"

# Run npm install if needed
[[ ! -d ./chutney/ui/node_modules ]] && echo "node_modules not found. Starting npm install" && cd ./chutney/ui && npm install && cd -
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,19 @@ body:
🙌 Please, make sure your bug report is unique 🦄 !
Did you search issues labeled with Bug ? If you find anything relevant to you, up-vote 👍 or add a comment 💬 !
For more information, please visit our [contribute section](https://github.com/chutney-testing/chutney/blob/master/CONTRIBUTING.md)
For more information, please visit our [contribute section](https://github.com/chutney-testing/chutney/blob/main/chutney/CONTRIBUTING.md)
- type: dropdown
id: component
attributes:
label: Which part of our software stack is concerned by the problem ?
multiple: true
options:
- Chutney
- Documentation
- IDEA plugin
- Kotlin DSL
validations:
required: true
- type: textarea
id: what-happened
attributes:
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,18 @@ body:
value: |
🙌 Please, make sure your feature request is unique 🦄 !
Did you search issues labeled with Enhancement ? If you find anything relevant to you, up-vote 👍 or add a comment 💬 !
- type: dropdown
id: component
attributes:
label: Which part of our software stack is concerned by the feature ?
multiple: true
options:
- Chutney
- Documentation
- IDEA plugin
- Kotlin DSL
validations:
required: true
- type: textarea
id: use-case
attributes:
Expand Down
53 changes: 53 additions & 0 deletions .github/actions/build-chutney/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: 'build chutney'
description: 'build chutney'
inputs:
goals:
default: "clean install -V -B"
description: "Maven goals to execute"
cache-artifacts:
default: ""
description: "path of artifacts to be cached"
runs:
using: "composite"
steps:
- name: Cache node
uses: actions/cache@v3
with:
path: '**/node'
key: node_cache

- name: Cache node_modules
uses: actions/cache@v3
with:
path: '**/node_modules'
key: node_module_cache

- uses: actions/checkout@v4

- name: Add the current IP address, long hostname and short hostname record to /etc/hosts file
if: ${{ ! contains(inputs.goals, '-DskipTests') }}
shell: bash
run: |
echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
- name: Build Chutney
shell: bash
run: |
cd ./chutney
echo "Running: ${{inputs.goals}}"
mvn ${{ inputs.goals }}
cd ..
- name: Codecov
if: ${{ ! contains(inputs.goals, '-DskipTests') }}
uses: codecov/codecov-action@v3

- name: Temporarily cache jar artifacts
if: inputs.cache-artifacts != ''
uses: actions/upload-artifact@v4
with:
name: chutney-artifacts
path: ${{inputs.cache-artifacts}}
retention-days: 1
overwrite: true

31 changes: 31 additions & 0 deletions .github/actions/build-dsl/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'build all projects'
description: 'build all projects sequentially'
inputs:
goals:
default: "clean build :chutney-kotlin-dsl:publishToMavenLocal"
description: "Gradle goals to execute"
cache-artifacts:
default: ""
description: "path of artifacts to be cached"

runs:
using: "composite"
steps:
- uses: actions/checkout@v4

- name: Build DSL
shell: bash
run: |
cd ./kotlin-dsl
echo "Running: ${{inputs.goals}}"
./gradlew ${{inputs.goals}} :chutney-kotlin-dsl:publishToMavenLocal
cd ..
- name: Temporarily cache jar artifacts
if: inputs.cache-artifacts != ''
uses: actions/upload-artifact@v4
with:
name: dsl-artifacts
path: ${{inputs.cache-artifacts}}
retention-days: 1
overwrite: true
31 changes: 31 additions & 0 deletions .github/actions/build-plugin/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: 'build all projects'
description: 'build all projects sequentially'
inputs:
goals:
default: "clean buildPlugin"
description: "Gradle goals to execute"
cache-artifacts:
default: ""
description: "path of artifacts to be cached"

runs:
using: "composite"
steps:
- uses: actions/checkout@v4

- name: Build Plugin
shell: bash
run: |
cd ./idea-plugin
echo "Running: ${{inputs.goals}}"
./gradlew ${{inputs.goals}}
cd ..
- name: Temporarily cache jar artifacts
if: inputs.cache-artifacts != ''
uses: actions/upload-artifact@v4
with:
name: plugin-artifacts
path: ${{inputs.cache-artifacts}}
retention-days: 1
overwrite: true
9 changes: 9 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: maven
directory: "/chutney/"
schedule:
interval: monthly
open-pull-requests-limit: 10
labels:
- dependencies
File renamed without changes.
File renamed without changes.
158 changes: 158 additions & 0 deletions .github/workflows/build-all-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@
name: "Build all template"

on:
workflow_call:
inputs:
skipTests:
default: false
type: boolean
description: "Skip tests if true"
release:
default: false
type: boolean
description: "Release if true"
cache-artifacts:
default: ""
type: string
description: "path of artifacts to be cached"
server-id:
type: string
default: github
description: "DistributionManagement repository id"

secrets:
gpg-private-key:
description: "Chutney gpg private key"
required: false
gpg-passphrase:
description: "Chutney gpg passphrase"
required: false
gpg-key-id:
description: "Chutney gpg key id"
required: false
maven-username:
description: "MAVEN_USERNAME secret"
required: false
maven-password:
description: "MAVEN_PASSWORD secret"
required: false
github-token:
description: "GITHUB_TOKEN secret"
required: false

outputs:
PROJECT_VERSION:
description: "Chutney Version"
value: ${{ jobs.all.outputs.PROJECT_VERSION }}

defaults:
run:
working-directory: .

jobs:
all:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: 17
cache: 'maven'
server-id: ${{inputs.server-id}}
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.gpg-private-key }}
gpg-passphrase: CHUTNEY_GPG_PASSPHRASE

- uses: actions/checkout@v4
- name: Retrieve chutney version from pom.xml
id: get-version
run: cd ./chutney && echo "PROJECT_VERSION=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT && cd ..

- name: Resolve chutney maven goal from inputs
id: chutney-goals
run: |
skipTestArg=""
mvnGoals="clean install"
if ${{ inputs.skipTests }}; then
skipTestArg="-DskipTests"
fi
if ${{ inputs.release }}; then
mvnGoals="deploy -P ${{inputs.server-id}}"
skipTestArg="-DskipTests"
fi
echo "CHUTNEY_GOALS=$mvnGoals $skipTestArg -V -B" >> $GITHUB_OUTPUT
- name: Build Chutney
id: build-chutney
uses: ./.github/actions/build-chutney
env:
MAVEN_USERNAME: ${{secrets.maven-username}}
MAVEN_PASSWORD: ${{secrets.maven-password}}
CHUTNEY_GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
with:
goals: ${{steps.chutney-goals.outputs.CHUTNEY_GOALS}}
cache-artifacts: ${{ inputs.cache-artifacts }}

- name: Install api-insecure
shell: bash
run: |
mvn org.apache.maven.plugins:maven-install-plugin:3.1.1:install-file \
-Dfile=./chutney/packaging/local-api-unsecure/target/chutney-local-api-unsecure-${{steps.get-version.outputs.PROJECT_VERSION}}.jar \
-DgroupId=com.chutneytesting \
-DartifactId=local-api-unsecure \
-Dversion=${{steps.get-version.outputs.PROJECT_VERSION}} \
-Dpackaging=jar
- name: Resolve dsl gradle goal from inputs
id: dsl-goals
run: |
skipTestArg=""
gradleGoals="clean build"
if ${{ inputs.skipTests }}; then
skipTestArg="-x test"
fi
if ${{ inputs.release }}; then
gradleGoals="publish -Pserver-id=${{inputs.server-id}}"
skipTestArg="-x test"
fi
echo "DSL_GOALS=$gradleGoals $skipTestArg" >> $GITHUB_OUTPUT
- name: Build DSL
uses: ./.github/actions/build-dsl
env:
MAVEN_USERNAME: ${{secrets.maven-username}}
MAVEN_PASSWORD: ${{secrets.maven-password}}
CHUTNEY_GPG_KEY_ID: ${{ secrets.gpg-key-id }}
CHUTNEY_GPG_KEY: ${{ secrets.gpg-private-key }}
CHUTNEY_GPG_PASSPHRASE: ${{ secrets.gpg-passphrase }}
with:
goals: ${{steps.dsl-goals.outputs.DSL_GOALS}}
cache-artifacts: ${{ inputs.cache-artifacts }}

- name: Resolve plugin gradle goal from inputs
if: ${{! inputs.release}}
id: plugin-goals
run: |
skipTestArg=""
if ${{ inputs.skipTests }}; then
skipTestArg="-x test"
fi
echo "PLUGIN_GOALS=clean buildPlugin $skipTestArg" >> $GITHUB_OUTPUT
- name: Build Plugin
if: ${{! inputs.release}}
uses: ./.github/actions/build-plugin
with:
goals: ${{steps.plugin-goals.outputs.PLUGIN_GOALS}}
cache-artifacts: ${{ inputs.cache-artifacts }}

outputs:
PROJECT_VERSION: ${{ steps.get-version.outputs.PROJECT_VERSION }}
13 changes: 13 additions & 0 deletions .github/workflows/build-all.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: "Build all"

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
uses: ./.github/workflows/build-all-template.yml
with:
skipTests: ${{ startsWith(github.head_ref, 'release/') }}
Loading

0 comments on commit 3989ad3

Please sign in to comment.