-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f078eb3
commit 2d5eedb
Showing
5 changed files
with
71 additions
and
6 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 |
---|---|---|
|
@@ -42,14 +42,19 @@ jobs: | |
ports: | ||
- 1080:1080 | ||
volumes: | ||
- ./fixtures:/fixtures | ||
- /zfixtures:/config | ||
env: | ||
MOCKSERVER_LOG_LEVEL: DEBUG | ||
MOCKSERVER_INITIALIZATION_JSON_PATH: /fixtures/expectationInitialiser.json | ||
MOCKSERVER_INITIALIZATION_JSON_PATH: /config/expectationInitialiser.json | ||
steps: | ||
- name: Checkout 🛎️ | ||
uses: actions/[email protected] | ||
|
||
- name: Ensure zfixtures directory exists | ||
run: | | ||
ls -la ${{ github.workspace }}/zfixtures | ||
cat ${{ github.workspace }}/zfixtures/expectationInitialiser.json | ||
- name: Install CircleCI CLI | ||
run: curl -fLSs https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/main/install.sh | bash | ||
|
||
|
@@ -60,11 +65,16 @@ jobs: | |
- name: Test Orb script | ||
run: | | ||
export FAKE_VALID_TOKEN=fake-valid-token | ||
bash src/scripts/upload.sh | ||
env: | ||
REPO_URL: https://github.com/$GITHUB_REPOSITORY | ||
TOKEN: fake-valid-token | ||
REPO_URL: ${{ github.server_url }}/${{ github.repository }} | ||
TOKEN: FAKE_VALID_TOKEN | ||
CIRCLE_JOB: test | ||
CIRCLE_SHA1: 948da8c01b17ac2164039f3150221d5cfcae7ecc | ||
FILES: junit_example.xml | ||
FILES: zfixtures/junit_example.xml | ||
MERGIFY_API_SERVER: http://localhost:1080 | ||
|
||
- name: Mockserver logs | ||
if: always() | ||
run: docker logs ${{ job.services.mockServer.id }} |
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,11 @@ | ||
services: | ||
mockServer: | ||
image: mockserver/mockserver:5.15.0 | ||
# command: -logLevel DEBUG | ||
ports: | ||
- 1080:1080 | ||
environment: | ||
MOCKSERVER_LOG_LEVEL: DEBUG | ||
MOCKSERVER_INITIALIZATION_JSON_PATH: /zfixtures/expectationInitializer.json | ||
volumes: | ||
- ./zfixtures:/zfixtures |
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,44 @@ | ||
#!/bin/bash | ||
|
||
# This example uses envsubst to support variable substitution in the string parameter type. | ||
# https://circleci.com/docs/orbs-best-practices/#accepting-parameters-as-strings-or-environment-variables | ||
|
||
#TO=$(circleci env subst "${PARAM_TO}") | ||
# If for any reason the TO variable is not set, default to "World" | ||
#echo "Hello ${TO:-World}!" | ||
|
||
set -x | ||
|
||
export REPO_URL=https://github.com/Mergifyio/circleci-ci-issues | ||
export FAKE_VALID_TOKEN=fake-valid-token | ||
export TOKEN=FAKE_VALID_TOKEN | ||
export CIRCLE_JOB=test | ||
export CIRCLE_SHA1=948da8c01b17ac2164039f3150221d5cfcae7ecc | ||
export FILES=zfixtures/junit_example.xml | ||
export MERGIFY_API_SERVER=http://localhost:1080 | ||
|
||
|
||
if [[ $REPO_URL =~ ^https:\/\/github\.com\/([a-zA-Z0-9._-]+)\/([a-zA-Z0-9._-]+)$ ]]; then | ||
REPO_FULL_NAME=${BASH_REMATCH[1]}/${BASH_REMATCH[2]} | ||
else | ||
echo "Invalid repository URL: $REPO_URL" | ||
exit 1 | ||
fi | ||
|
||
# TODO: support multiple files | ||
curl -X POST \ | ||
-H "Authorization: bearer ${!TOKEN}" \ | ||
-F name=${CIRCLE_JOB} \ | ||
-F provider=circleci \ | ||
-F head_sha=${CIRCLE_SHA1} \ | ||
-F files=@${FILES} \ | ||
-o result.json \ | ||
${MERGIFY_API_SERVER}/repos/${REPO_FULL_NAME}/ci_issues_upload \ | ||
|
||
echo "Display result" | ||
cat result.json | ||
|
||
GIGID=$(cat result.json | jq -r .gigid) | ||
echo "::notice title=CI Issues report::CI_ISSUE_GIGID=$GIGID" | ||
|
||
# echo "CI_ISSUE_GIGID=$GIGID" >> "$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
File renamed without changes.