forked from port-labs/ocean
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into clickup-integrations
- Loading branch information
Showing
112 changed files
with
1,318 additions
and
617 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,7 +41,7 @@ jobs: | |
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
./scripts/bump-all.sh ^${{ steps.version.outputs.version }} | ||
./scripts/bump-all.sh ${{ steps.version.outputs.version }} | ||
- name: Open pull request | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: 🌊 Ocean Core Tests | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
detect-changes: | ||
uses: ./.github/workflows/detect-changes-matrix.yml | ||
test: | ||
name: 🌊 Ocean Core Tests | ||
needs: detect-changes | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.detect-changes.outputs.core == 'true' }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
run: | | ||
make install | ||
- name: Build core for smoke test | ||
run: | | ||
make build | ||
- name: Run fake integration for core test | ||
env: | ||
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }} | ||
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }} | ||
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }} | ||
SMOKE_TEST_SUFFIX: ${{ github.run_id }} | ||
run: | | ||
./scripts/run-smoke-test.sh | ||
- name: Unit and Smoke Test Core | ||
env: | ||
PYTEST_ADDOPTS: --junitxml=junit/test-results-ocean/core.xml | ||
PORT_CLIENT_ID: ${{ secrets.PORT_CLIENT_ID }} | ||
PORT_CLIENT_SECRET: ${{ secrets.PORT_CLIENT_SECRET }} | ||
PORT_BASE_URL: ${{ secrets.PORT_BASE_URL }} | ||
SMOKE_TEST_SUFFIX: ${{ github.run_id }} | ||
run: | | ||
make test | ||
- name: Install current core for all integrations | ||
run: | | ||
echo "Installing local core for all integrations" | ||
SCRIPT_TO_RUN='make install/local-core' make execute/all | ||
- name: Test all integrations with current core | ||
run: | | ||
echo "Testing all integrations with local core" | ||
SCRIPT_TO_RUN="PYTEST_ADDOPTS=--junitxml=${PWD}/junit/test-results-core-change/\`pwd | xargs basename\`.xml make test" make execute/all | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: ${{ always() }} | ||
with: | ||
report_paths: '**/junit/test-results-**/*.xml' | ||
include_passed: true | ||
require_tests: true | ||
fail_on_failure: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,39 +4,53 @@ on: | |
outputs: | ||
matrix: | ||
value: ${{ jobs.detect-changes.outputs.matrix }} | ||
description: "Matrix of changed integrations / Ocean Core per git commit changes" | ||
integrations: | ||
description: "Matrix of changed integrations per git commit changes" | ||
value: ${{ jobs.detect-changes.outputs.integrations }} | ||
core: | ||
value: ${{ jobs.detect-changes.outputs.core }} | ||
description: "Determine if any core changes per git commit changes" | ||
|
||
jobs: | ||
detect-changes: | ||
name: Detect changes | ||
runs-on: ubuntu-latest | ||
outputs: | ||
matrix: ${{ steps.set-matrix.outputs.matrix }} | ||
matrix: ${{ steps.set-all-matrix.outputs.matrix }} | ||
integrations: ${{ steps.set-all-matrix.outputs.integrations }} | ||
core: ${{ steps.set-all-matrix.outputs.core }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Get list of changed files | ||
id: changed-files | ||
uses: tj-actions/[email protected] | ||
- name: Set matrix | ||
id: set-matrix | ||
run: | | ||
folders_to_ignore="integrations/*/LICENSE.md|integrations/*/README.md|integrations/*/CONTRIBUTING.md|integrations/*/CHANGELOG.md" | ||
changed_folders=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" \ | ||
| tr ' ' '\n' | grep '^integrations/' | grep -v '^($folders_to_ignore)' \ | ||
| egrep -v '_infra' \ | ||
| cut -d'/' -f2 | sort | uniq) | ||
if [ -z "$changed_folders" ]; then | ||
changed_folders="" | ||
fi | ||
folders_to_ignore="integrations/|scripts/|assets/|docs/|LICENSE.md|README.md|CONTRIBUTING.md|CHANGELOG.md" | ||
other_changes=$(echo "${{ steps.changed-files.outputs.all_changed_files }}" | tr ' ' '\n' | grep -v '^($folders_to_ignore)' | wc -l) | ||
if [ "$other_changes" -ne 0 ]; then | ||
# Add the root directory to the matrix if there are changes outside the integrations folder | ||
changed_folders=$(echo -e "$changed_folders\n.") | ||
fi | ||
uses: tj-actions/[email protected] | ||
with: | ||
dir_names: true | ||
json: true | ||
dir_names_max_depth: 2 | ||
escape_json: false | ||
files_yaml: | | ||
core: | ||
- '!integrations/**' | ||
- '!scripts/*' | ||
- '!scripts/*' | ||
- '!./*.md' | ||
integrations: | ||
- 'integrations/**' | ||
- '!integrations/**/*.md' | ||
matrix=$(echo "$changed_folders" | jq -R -s -c 'split("\n") | map(select(length > 0))') | ||
echo "matrix=$matrix" >> $GITHUB_OUTPUT | ||
- name: Set integrations and all matrix | ||
id: set-all-matrix | ||
run: | | ||
INTEGRATIONS=$(node -e 'integrations=${{ steps.changed-files.outputs.integrations_all_changed_files }};console.log(JSON.stringify(integrations.map(integration => integration.split("/")[1])))') | ||
HAS_CORE=${{ steps.changed-files.outputs.core_all_changed_files != '[]' }} | ||
echo "Core changes : ${HAS_CORE}" | ||
MATRIX=$(node -e "integrations=${INTEGRATIONS}; hasCore=${HAS_CORE}; console.log(JSON.stringify(hasCore ? integrations.concat(['.']) : integrations))") | ||
echo "Integration changes : ${INTEGRATIONS}" | ||
echo "All changes : ${MATRIX}" | ||
echo "core=${HAS_CORE}" >> $GITHUB_OUTPUT | ||
echo "integrations=${INTEGRATIONS}" >> $GITHUB_OUTPUT | ||
echo "matrix=${MATRIX}" >> $GITHUB_OUTPUT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: Integrations Test | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
detect-changes: | ||
uses: ./.github/workflows/detect-changes-matrix.yml | ||
test: | ||
name: ${{ format('🚢 {0}', matrix.folder) }} | ||
needs: detect-changes | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.detect-changes.outputs.integrations != '[]' }} | ||
strategy: | ||
max-parallel: 5 | ||
matrix: | ||
folder: ${{ fromJson(needs.detect-changes.outputs.integrations) }} | ||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install poetry | ||
run: pipx install poetry | ||
|
||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
cache: 'poetry' | ||
|
||
- name: Install dependencies | ||
working-directory: ${{ format('integrations/{0}', matrix.folder) }} | ||
run: | | ||
make install | ||
- name: Test | ||
working-directory: ${{ format('integrations/{0}', matrix.folder) }} | ||
env: | ||
PYTEST_ADDOPTS: --junitxml=junit/test-results-${{ format('integrations/{0}', matrix.folder) }}.xml | ||
run: | | ||
make test | ||
- name: Publish Test Report | ||
uses: mikepenz/action-junit-report@v4 | ||
if: ${{ always() }} | ||
with: | ||
report_paths: '**/junit/test-results-**/*.xml' | ||
include_passed: true | ||
require_tests: true | ||
fail_on_failure: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.