Skip to content

Commit

Permalink
Testing operator job
Browse files Browse the repository at this point in the history
  • Loading branch information
tiagobento committed Apr 26, 2024
1 parent 671b7a0 commit b44eb23
Show file tree
Hide file tree
Showing 658 changed files with 158,180 additions and 110 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/ci_kogito_serverless_operator_e2e_tests.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: "CI :: Kogito Serverless Operator :: E2E Tests"

on:
push:
branches: [main]
pull_request:
branches: ["**"]
types: [opened, reopened, ready_for_review, synchronize]

concurrency:
group: ${{ github.event.pull_request && format('ci-build-full-pr-kogito-serverless-operator-{0}', github.event.pull_request.number) || format('ci-build-full-push-main-kogito-serverless-operator-{0}', github.sha) }}
cancel-in-progress: true

env:
TMPDIR: "/tmp"

jobs:
run:
if: github.event.pull_request.draft == false
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout @ GitHub default"
uses: actions/checkout@v3

- name: "Checkout @ Simulated squashed-merge if PR"
id: checkout_pr
uses: ./.github/actions/checkout-pr
with:
ref: ${{ github.base_ref }}

- name: "Setup CI patterns"
id: ci_patterns
uses: ./.github/actions/setup-ci-patterns

- name: "Setup build mode {none,run}"
id: setup_build_mode
shell: bash
run: |
export CHANGED_SOURCE_PATHS=($(eval "git diff --name-only ${{ steps.checkout_pr.outputs.base_sha }} ${{ steps.checkout_pr.outputs.head_sha }} -- ${{ steps.ci_patterns.outputs.non_source_files_patterns_for_git_diff }}"))
echo "Changed source paths:"
echo ${#CHANGED_SOURCE_PATHS[@]}
printf '%s\n' "${CHANGED_SOURCE_PATHS[@]}"
export CHANGED_SOURCE_PATHS_KOGITO_SERVERLESS_OPERATOR_OR_UPSTREAM=($(printf '%s\n' "${CHANGED_SOURCE_PATHS[@]}" | grep -v -e "^packages" -e "^examples")) # TODO: Tiago --> Fix this
echo "Changed source paths in "@kie-tools/kogito-serverless-operator" or upstream:"
echo ${#CHANGED_SOURCE_PATHS_KOGITO_SERVERLESS_OPERATOR_OR_UPSTREAM[@]}
printf '%s\n' "${CHANGED_SOURCE_PATHS_KOGITO_SERVERLESS_OPERATOR_OR_UPSTREAM[@]}"
if [ ${#CHANGED_SOURCE_PATHS[@]} -eq 0 ]; then
echo 'No source files changed; `CI :: Kogito Serverless Operator :: E2E Tests` (none) will run.'
echo "mode=none" >> $GITHUB_OUTPUT
elif [ ! ${{ github.event.pull_request }} ]; then
echo 'Push to the `main` branch happened; `CI :: Kogito Serverless Operator :: E2E Tests` (full) will run.'
echo "mode=run" >> $GITHUB_OUTPUT
elif [ ${#CHANGED_SOURCE_PATHS_KOGITO_SERVERLESS_OPERATOR_OR_UPSTREAM[@]} -eq 0 ]; then
echo 'No source files changed in "@kie-tools/kogito-serverless-operator" or upstream; `CI :: Kogito Serverless Operator :: E2E Tests` (none) will run.'
echo "mode=none" >> $GITHUB_OUTPUT
else
echo 'Source files changed in "@kie-tools/kogito-serverless-operator" or upstream; `CI :: Kogito Serverless Operator :: E2E Tests` (full) will run.'
echo "mode=full" >> $GITHUB_OUTPUT
fi
echo "Done"
- name: "Setup environment"
# if: steps.setup_build_mode.outputs.mode != 'none' # TODO: Tiago --> Temporarily commented until I fix the package filtering.
uses: ./.github/actions/setup-env

- name: "Bootstrap"
# if: steps.setup_build_mode.outputs.mode == 'run' # TODO: Tiago --> Temporarily commented until I fix the package filtering.
uses: ./.github/actions/bootstrap
with:
pnpm_filter_string: -F "@kie-tools/kogito-serverless-operator..."

- name: "Build upstream"
# if: steps.setup_build_mode.outputs.mode == 'run' # TODO: Tiago --> Temporarily commented until I fix the package filtering.
env:
KIE_TOOLS_BUILD__runLinters: "false"
KIE_TOOLS_BUILD__runTests: "false"
KIE_TOOLS_BUILD__runEndToEndTests: "false"
KIE_TOOLS_BUILD__buildContainerImages: "true"
run: |
pnpm -F "@kie-tools/kogito-serverless-operator^..." build:prod
- name: "Build @kie-tools/kogito-serverless-operator"
# if: steps.setup_build_mode.outputs.mode == 'run' # TODO: Tiago --> Temporarily commented until I fix the package filtering.
env:
KIE_TOOLS_BUILD__runLinters: "true"
KIE_TOOLS_BUILD__runTests: "true"
KIE_TOOLS_BUILD__runEndToEndTests: "true"
KIE_TOOLS_BUILD__buildContainerImages: "true"
KOGITO_SERVERLESS_OPERATOR__runEndToEndTests: "true"
run: |
pnpm -F "@kie-tools/kogito-serverless-operator" build:prod
- name: "Check hanging uncommitted files (you should commit those!)"
if: always() && !cancelled() && steps.setup_build_mode.outputs.mode != 'none'
shell: bash
run: |
git diff
[ "0" == "$(git diff | wc -l | tr -d ' ')" ]
- name: "Upload reports and artifacts"
if: always() && !cancelled() && steps.setup_build_mode.outputs.mode != 'none'
uses: ./.github/actions/upload-ci-reports-and-artifacts

- name: "Print storage usage (after build)"
if: always() && !cancelled()
shell: bash
run: |
df -h .
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,19 @@ packages/kie-sandbox-fs/coverage
packages/kie-sandbox-fs/junit
packages/kie-sandbox-fs/*-0.0.0-development.tgz

# kogito-serverless-operator
# These files are generated by Cekit, we can ignore the operator-sdk ones.
packages/kogito-serverless-operator/bundle.Dockerfile
packages/kogito-serverless-operator/Dockerfile
# Test binary, built with `go test -c`
packages/kogito-serverless-operator/**/*.test
# Output of the go coverage tool, specifically when used with LiteIDE
packages/kogito-serverless-operator/**/*.out
# Build
packages/kogito-serverless-operator/bin/
packages/kogito-serverless-operator/target/
packages/kogito-serverless-operator/e2e-test-report.xml

#angular
**/.angular

Expand Down
6 changes: 2 additions & 4 deletions devbox.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,7 @@
"kubernetes-helm": "3.13.3",
"gnumake": "4.4.1",
"go": "1.21.8",
"python": "3.12.2",
"operator-sdk": "1.34.1",
"kubebuilder": "3.14.0"
"python": "3.12.2"
},
"env": {
"PLAYWRIGHT_BROWSERS_PATH": "0",
Expand All @@ -22,7 +20,7 @@
"shell": {
"init_hook": [
". $VENV_DIR/bin/activate",
"[[ $OSTYPE == 'darwin'* ]] && export PATH=$(echo $PATH | tr ':' '\n' | sed '\\|^/nix/store/|d' | paste -sd ':' -)"
"[[ $OSTYPE == 'darwin'* ]] && export PATH=$(echo $PATH | tr ':' '\n' | grep -vi 'xcode\\|clang\\|cctools' | paste -sd ':' -)"
],
"scripts": {
"versions": [
Expand Down
96 changes: 0 additions & 96 deletions devbox.lock
Original file line number Diff line number Diff line change
Expand Up @@ -141,54 +141,6 @@
}
}
},
"[email protected]": {
"last_modified": "2024-03-22T07:26:23-04:00",
"resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#kubebuilder",
"source": "devbox-search",
"version": "3.14.0",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/hdggigkq5ibqvk3ksmq7cwlyn1l2gdsv-kubebuilder-3.14.0",
"default": true
}
],
"store_path": "/nix/store/hdggigkq5ibqvk3ksmq7cwlyn1l2gdsv-kubebuilder-3.14.0"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/7ykpi9d6jd4zhxs5c6lfbb9p5kgm5m3p-kubebuilder-3.14.0",
"default": true
}
],
"store_path": "/nix/store/7ykpi9d6jd4zhxs5c6lfbb9p5kgm5m3p-kubebuilder-3.14.0"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/jpqwxd42bcfkxljy0pkqagbnpifdxvpx-kubebuilder-3.14.0",
"default": true
}
],
"store_path": "/nix/store/jpqwxd42bcfkxljy0pkqagbnpifdxvpx-kubebuilder-3.14.0"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/c492irdhgzr6wbl6zggn5bw23dlgxb9r-kubebuilder-3.14.0",
"default": true
}
],
"store_path": "/nix/store/c492irdhgzr6wbl6zggn5bw23dlgxb9r-kubebuilder-3.14.0"
}
}
},
"[email protected]": {
"last_modified": "2024-01-27T14:55:31Z",
"resolved": "github:NixOS/nixpkgs/160b762eda6d139ac10ae081f8f78d640dd523eb#kubernetes-helm",
Expand Down Expand Up @@ -350,54 +302,6 @@
}
}
},
"[email protected]": {
"last_modified": "2024-03-22T07:26:23-04:00",
"resolved": "github:NixOS/nixpkgs/a3ed7406349a9335cb4c2a71369b697cecd9d351#operator-sdk",
"source": "devbox-search",
"version": "1.34.1",
"systems": {
"aarch64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/39bndv1fk8rrdi1a0xlfaw5qhgylnzkk-operator-sdk-1.34.1",
"default": true
}
],
"store_path": "/nix/store/39bndv1fk8rrdi1a0xlfaw5qhgylnzkk-operator-sdk-1.34.1"
},
"aarch64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/n9ln3a2whzwp0x2ik3rxh10wn7ra85r5-operator-sdk-1.34.1",
"default": true
}
],
"store_path": "/nix/store/n9ln3a2whzwp0x2ik3rxh10wn7ra85r5-operator-sdk-1.34.1"
},
"x86_64-darwin": {
"outputs": [
{
"name": "out",
"path": "/nix/store/y0vi2nvhsgakbvlmbhdpsqdnl83l8q65-operator-sdk-1.34.1",
"default": true
}
],
"store_path": "/nix/store/y0vi2nvhsgakbvlmbhdpsqdnl83l8q65-operator-sdk-1.34.1"
},
"x86_64-linux": {
"outputs": [
{
"name": "out",
"path": "/nix/store/h607xcilqpwsc0mna9bc6yilj4v3q4y3-operator-sdk-1.34.1",
"default": true
}
],
"store_path": "/nix/store/h607xcilqpwsc0mna9bc6yilj4v3q4y3-operator-sdk-1.34.1"
}
}
},
"[email protected]": {
"last_modified": "2024-03-22T11:26:23Z",
"plugin_version": "0.0.3",
Expand Down
Loading

0 comments on commit b44eb23

Please sign in to comment.