Skip to content

Commit

Permalink
feat: conclusion
Browse files Browse the repository at this point in the history
  • Loading branch information
bojanrajh committed Oct 27, 2023
1 parent 53e0d4f commit d723ff3
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 85 deletions.
1 change: 1 addition & 0 deletions .github/scripts/trigger-workflow.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ async function triggerWorkflow() {
repo: process.env.DEV_HUB_REPO,
sha: process.env.DEV_HUB_SHA,
check: process.env.DEV_HUB_CHECK,
conclusion: process.env.DEV_HUB_CONCLUSION,
},
});

Expand Down
177 changes: 92 additions & 85 deletions .github/workflows/external-healthcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,99 @@ on:

jobs:

update-check-run:
trigger-build:
runs-on: ubuntu-latest
needs:
- update-check-run

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Print inputs
run: |
echo "branch" ${{ inputs.branch }}
echo "repo" ${{ inputs.repo }}
echo "sha" ${{ inputs.sha }}
ORG=$(dirname ${{ inputs.repo }})
BRANCH=${{ inputs.branch }}
if [[ "${{ inputs.repo }}" == *"/frontends" ]]; then
echo "Embedding frontends"
sed -i "0,/ORG_FRONTENDS.*/s/.*ORG_FRONTENDS.*/ORG_FRONTENDS=$ORG/" ./.github/scripts/embed.sh
sed -i "0,/BRANCH_FRONTENDS.*/s/.*BRANCH_FRONTENDS.*/BRANCH_FRONTENDS=$BRANCH/" ./.github/scripts/embed.sh
elif [[ "${{ inputs.repo }}" == *"/admin-extension-sdk" ]]; then
echo "Embedding admin-extension-sdk"
sed -i "0,/ORG_ADMIN_EXTENSION_SDK.*/s/.*ORG_ADMIN_EXTENSION_SDK.*/ORG_ADMIN_EXTENSION_SDK=$ORG/" ./.github/scripts/embed.sh
sed -i "0,/BRANCH_ADMIN_EXTENSION_SDK.*/s/.*BRANCH_ADMIN_EXTENSION_SDK.*/BRANCH_ADMIN_EXTENSION_SDK=$BRANCH/" ./.github/scripts/embed.sh
elif [[ "${{ inputs.repo }}" == *"/meteor-icon-kit" ]]; then
echo "Embedding meteor-icon-kit"
sed -i "0,/ORG_METEOR_ICON_KIT.*/s/.*ORG_METEOR_ICON_KIT.*/ORG_METEOR_ICON_KIT=$ORG/" ./.github/scripts/embed.sh
sed -i "0,/BRANCH_METEOR_ICON_KIT.*/s/.*BRANCH_METEOR_ICON_KIT.*/BRANCH_METEOR_ICON_KIT=$BRANCH/" ./.github/scripts/embed.sh
elif [[ "${{ inputs.repo }}" == *"/meteor-component-library" ]]; then
echo "Embedding meteor-component-library"
sed -i "0,/ORG_METEOR_COMPONENT_LIBRARY.*/s/.*ORG_METEOR_COMPONENT_LIBRARY.*/ORG_METEOR_COMPONENT_LIBRARY=$ORG/" ./.github/scripts/embed.sh
sed -i "0,/BRANCH_METEOR_COMPONENT_LIBRARY.*/s/.*BRANCH_METEOR_COMPONENT_LIBRARY.*/BRANCH_METEOR_COMPONENT_LIBRARY=$BRANCH/" ./.github/scripts/embed.sh
elif [[ "${{ inputs.repo }}" == *"/docs" ]]; then
echo "Embedding docs"
sed -i "0,/ORG_DOCS.*/s/.*ORG_DOCS.*/ORG_DOCS=$ORG/" ./.github/scripts/embed.sh
sed -i "0,/BRANCH_DOCS.*/s/.*BRANCH_DOCS.*/BRANCH_DOCS=$BRANCH/" ./.github/scripts/embed.sh
else
echo "Unknown repository ${{inputs.repo}}"
echo "Branch ${{inputs.branch}}"
exit 1
fi
cat ./.github/scripts/embed.sh
- name: Prepare
uses: ./.github/actions/checkout-install
with:
apt: true

- name: Embed repos
env:
GITLAB_FRONTENDS_USERNAME: ${{ secrets.GITLAB_FRONTENDS_USERNAME }}
GITLAB_FRONTENDS_ACCESS_KEY: ${{ secrets.GITLAB_FRONTENDS_ACCESS_KEY }}
FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
FIGMA_FILE: ${{ secrets.FIGMA_FILE }}
run: |
chmod +x ./.github/scripts/embed.sh
.github/scripts/embed.sh
- name: Test dev
run: |
export NODE_OPTIONS="--max-old-space-size=8096"
pnpm run test
- name: Build
run: |
export NODE_OPTIONS="--max-old-space-size=8096"
export USERCENTRICS="65ynhGFvE"
pnpm run build
- name: Test build
run: |
export NODE_OPTIONS="--max-old-space-size=8096"
pnpm run test:build
- name: Mark as successful
id: status
run: |
echo "::set-output name=success::${{ toJson(needs.workflow_run.conclusion == 'success') }}"
update-healthcheck-success:
name: Test build
runs-on: ubuntu-latest
#needs:
# - trigger-build
needs:
- trigger-build
if: ${{ always() }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
Expand All @@ -49,85 +137,4 @@ jobs:
DEV_HUB_REPO: ${{ inputs.repo }}
DEV_HUB_SHA: ${{ inputs.sha }}
DEV_HUB_CHECK: ${{ inputs.check }}

# trigger-build:
# runs-on: ubuntu-latest
# needs:
# - update-check-run

# steps:
# - name: Checkout repository
# uses: actions/checkout@v3

# - name: Print inputs
# run: |
# echo "branch" ${{ inputs.branch }}
# echo "repo" ${{ inputs.repo }}
# echo "sha" ${{ inputs.sha }}

# ORG=$(dirname ${{ inputs.repo }})
# BRANCH=${{ inputs.branch }}

# if [[ "${{ inputs.repo }}" == *"/frontends" ]]; then
# echo "Embedding frontends"
# sed -i "0,/ORG_FRONTENDS.*/s/.*ORG_FRONTENDS.*/ORG_FRONTENDS=$ORG/" ./.github/scripts/embed.sh
# sed -i "0,/BRANCH_FRONTENDS.*/s/.*BRANCH_FRONTENDS.*/BRANCH_FRONTENDS=$BRANCH/" ./.github/scripts/embed.sh

# elif [[ "${{ inputs.repo }}" == *"/admin-extension-sdk" ]]; then
# echo "Embedding admin-extension-sdk"
# sed -i "0,/ORG_ADMIN_EXTENSION_SDK.*/s/.*ORG_ADMIN_EXTENSION_SDK.*/ORG_ADMIN_EXTENSION_SDK=$ORG/" ./.github/scripts/embed.sh
# sed -i "0,/BRANCH_ADMIN_EXTENSION_SDK.*/s/.*BRANCH_ADMIN_EXTENSION_SDK.*/BRANCH_ADMIN_EXTENSION_SDK=$BRANCH/" ./.github/scripts/embed.sh

# elif [[ "${{ inputs.repo }}" == *"/meteor-icon-kit" ]]; then
# echo "Embedding meteor-icon-kit"
# sed -i "0,/ORG_METEOR_ICON_KIT.*/s/.*ORG_METEOR_ICON_KIT.*/ORG_METEOR_ICON_KIT=$ORG/" ./.github/scripts/embed.sh
# sed -i "0,/BRANCH_METEOR_ICON_KIT.*/s/.*BRANCH_METEOR_ICON_KIT.*/BRANCH_METEOR_ICON_KIT=$BRANCH/" ./.github/scripts/embed.sh

# elif [[ "${{ inputs.repo }}" == *"/meteor-component-library" ]]; then
# echo "Embedding meteor-component-library"
# sed -i "0,/ORG_METEOR_COMPONENT_LIBRARY.*/s/.*ORG_METEOR_COMPONENT_LIBRARY.*/ORG_METEOR_COMPONENT_LIBRARY=$ORG/" ./.github/scripts/embed.sh
# sed -i "0,/BRANCH_METEOR_COMPONENT_LIBRARY.*/s/.*BRANCH_METEOR_COMPONENT_LIBRARY.*/BRANCH_METEOR_COMPONENT_LIBRARY=$BRANCH/" ./.github/scripts/embed.sh

# elif [[ "${{ inputs.repo }}" == *"/docs" ]]; then
# echo "Embedding docs"
# sed -i "0,/ORG_DOCS.*/s/.*ORG_DOCS.*/ORG_DOCS=$ORG/" ./.github/scripts/embed.sh
# sed -i "0,/BRANCH_DOCS.*/s/.*BRANCH_DOCS.*/BRANCH_DOCS=$BRANCH/" ./.github/scripts/embed.sh

# else
# echo "Unknown repository ${{inputs.repo}}"
# echo "Branch ${{inputs.branch}}"
# exit 1
# fi

# cat ./.github/scripts/embed.sh

# - name: Prepare
# uses: ./.github/actions/checkout-install
# with:
# apt: true

# - name: Embed repos
# env:
# GITLAB_FRONTENDS_USERNAME: ${{ secrets.GITLAB_FRONTENDS_USERNAME }}
# GITLAB_FRONTENDS_ACCESS_KEY: ${{ secrets.GITLAB_FRONTENDS_ACCESS_KEY }}
# FIGMA_TOKEN: ${{ secrets.FIGMA_TOKEN }}
# FIGMA_FILE: ${{ secrets.FIGMA_FILE }}
# run: |
# chmod +x ./.github/scripts/embed.sh
# .github/scripts/embed.sh

# - name: Test dev
# run: |
# export NODE_OPTIONS="--max-old-space-size=8096"
# pnpm run test

# - name: Build
# run: |
# export NODE_OPTIONS="--max-old-space-size=8096"
# export USERCENTRICS="65ynhGFvE"
# pnpm run build

# - name: Test build
# run: |
# export NODE_OPTIONS="--max-old-space-size=8096"
# pnpm run test:build
DEV_HUB_CONCLUSION: ${{ steps.status.outputs.success == 'true' && 'success' || 'failure' }}

0 comments on commit d723ff3

Please sign in to comment.