-
Notifications
You must be signed in to change notification settings - Fork 77
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLOUDP-194416: Isolate CI unit tests to always run (#1095)
Signed-off-by: Jose Vazquez <[email protected]>
- Loading branch information
Showing
11 changed files
with
199 additions
and
112 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 |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: CloudTestsForked | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
forked: | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
concurrency: | ||
group: cloud-tests-forked | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
allowed-forked: | ||
name: Allowed action | ||
runs-on: ubuntu-latest | ||
if: | | ||
${{ github.actor == 'dependabot[bot]' }} || | ||
contains(github.event.pull_request.labels.*.name, 'safe-to-test') | ||
steps: | ||
- name: allowed message | ||
run: echo "Allowed to run" | ||
|
||
int-tests: | ||
needs: allowed-forked | ||
uses: ./.github/workflows/integration-test.yml | ||
secrets: inherit | ||
with: | ||
forked: true | ||
|
||
e2e-tests-forked: | ||
needs: allowed-forked | ||
uses: ./.github/workflows/test-e2e.yml | ||
secrets: inherit | ||
with: | ||
forked: true | ||
|
||
openshift-upgrade-test: | ||
needs: allowed-forked | ||
uses: ./.github/workflows/openshift-upgrade-test.yaml | ||
secrets: inherit | ||
with: | ||
forked: 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: CloudTests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
forked: | ||
type: boolean | ||
required: false | ||
default: false | ||
|
||
concurrency: | ||
group: cloud-tests | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
allowed: | ||
name: Allowed | ||
runs-on: ubuntu-latest | ||
if: | | ||
github.event_name == 'workflow_dispatch' || | ||
github.ref == 'refs/heads/main' || | ||
(github.event.pull_request.head.repo.full_name == github.repository && github.actor != 'dependabot[bot]') | ||
steps: | ||
- name: allowed message | ||
run: echo "Allowed to run" | ||
- name: check Github action bot comment | ||
if: github.event_name == 'pull_request' | ||
uses: peter-evans/find-comment@v2 | ||
id: find-bot-comment | ||
with: | ||
issue-number: ${{ github.event.pull_request.number }} | ||
comment-author: github-actions[bot] | ||
body-includes: 'https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit' | ||
- name: edit comment if exists | ||
if: github.event_name == 'pull_request' && steps.find-bot-comment.outputs.comment-id != '' | ||
uses: peter-evans/create-or-update-comment@v3 | ||
with: | ||
edit-mode: replace | ||
comment-id: ${{ steps.find-bot-comment.outputs.comment-id }} | ||
body: https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/${{ github.event.pull_request.head.sha }} | ||
- name: comment PR | ||
if: github.event_name == 'pull_request' && steps.find-bot-comment.outputs.comment-id == '' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
gh pr comment ${{ github.event.pull_request.number }} -R mongodb/mongodb-atlas-kubernetes -b "https://app.codecov.io/github/mongodb/mongodb-atlas-kubernetes/commit/${{ github.event.pull_request.head.sha }}" | ||
int-tests: | ||
needs: allowed | ||
uses: ./.github/workflows/integration-test.yml | ||
secrets: inherit | ||
with: | ||
forked: false | ||
|
||
e2e-tests: | ||
needs: allowed | ||
uses: ./.github/workflows/test-e2e.yml | ||
secrets: inherit | ||
with: | ||
forked: false | ||
|
||
openshift-upgrade-test: | ||
needs: allowed | ||
uses: ./.github/workflows/openshift-upgrade-test.yaml | ||
secrets: inherit | ||
with: | ||
forked: false |
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
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,32 @@ | ||
name: Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
production-code-changed: | ||
description: "Was production code changed?" | ||
value: ${{ jobs.paths-filter.outputs.production-code-changed }} | ||
|
||
jobs: | ||
paths-filter: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
production-code-changed: ${{ steps.filter.outputs.production-code-changed }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: dorny/paths-filter@v2 | ||
id: filter | ||
with: | ||
filters: | | ||
production-code-changed: | ||
- 'cmd/**/!(*_test.go)' | ||
- 'pkg/**/!(*_test.go)' | ||
# run only if 'production-code' files were changed | ||
- name: production code changed | ||
if: steps.filter.outputs.production-code-changed == 'true' | ||
run: echo "Production code was changed" | ||
|
||
# run only if not 'production-code' files were changed | ||
- name: production code not changed | ||
if: steps.filter.outputs.production-code-changed != 'true' | ||
run: echo "Production code was not changed" |
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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Unit Tests. | ||
name: Unit Tests | ||
|
||
on: | ||
workflow_call: | ||
|
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