Skip to content

Commit

Permalink
chore: report release job of release workflow needs output from the r…
Browse files Browse the repository at this point in the history
…elease job (#3418)

Setting environment variables doesn't persist between jobs,
so use output instead to record whether a build was successful.

Also fixed a test that started to fail when "This month" became December
rather than November. Choosing fixed dates should fix this problem.
  • Loading branch information
jenniferarnesen authored Dec 5, 2024
1 parent 32b01ed commit 0dc3e8c
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ env:
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}
D2_APP_HUB_TOKEN: ${{secrets.DHIS2_BOT_APPHUB_TOKEN}}
CI: true
build_exists: false

jobs:
release:
runs-on: ubuntu-latest
if: >
${{ !github.event.push.repository.fork &&
github.actor != 'dependabot[bot]' }}
outputs:
build_exists: ${{ steps.check_build.outputs.build_exists }}
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -39,17 +40,17 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }}

- name: Set build_exists env var
- name: Set build_exists output
id: check_build
run: |
if ls build/bundle/maps-*.zip 1> /dev/null 2>&1; then
echo "build_exists=true" >> $GITHUB_ENV
echo "build_exists=yes" >> $GITHUB_OUTPUT
else
echo "build_exists=false" >> $GITHUB_ENV
echo "build_exists=no" >> $GITHUB_OUTPUT
fi
- name: Publish to AppHub
if: env.build_exists == 'true'
if: ${{ steps.check_build.outputs.build_exists == 'yes' }}
run: yarn run d2-app-scripts publish

report-release-result:
Expand All @@ -58,19 +59,19 @@ jobs:
needs: release
steps:
- name: Checkout code
if: ${{ env.build_exists == 'true' && success() }}
if: ${{ needs.release.outputs.build_exists == 'yes' && success() }}
uses: actions/checkout@v4
with:
ref: master
fetch-depth: 0

- name: Extract version
if: ${{ env.build_exists == 'true' && success() }}
if: ${{ needs.release.outputs.build_exists == 'yes' && success() }}
id: extract_version
uses: Saionaro/[email protected]

- name: Send success message to analytics-internal-bot slack channel
if: ${{ env.build_exists == 'true' && success() }}
if: ${{ needs.release.outputs.build_exists == 'yes' && success() }}
id: slack_success
uses: slackapi/[email protected]
with:
Expand Down
8 changes: 5 additions & 3 deletions cypress/integration/layers/thematiclayer.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ context('Thematic Layers', () => {
.selectIndicatorGroup('Stock')
.selectIndicator('BCG Stock PHU')
.selectTab('Period')
.selectRelativePeriod('This month')
.selectPeriodType('Start/end dates')
.typeStartDate(`${CURRENT_YEAR}-11-01`)
.typeEndDate(`${CURRENT_YEAR}-11-30`)
.selectTab('Style')
.selectIncludeNoDataOU()
.selectTab('Org Units')
Expand Down Expand Up @@ -138,7 +140,7 @@ context('Thematic Layers', () => {
cy.get('#dhis2-map-container')
.findByDataTest('dhis2-uicore-componentcover', EXTENDED_TIMEOUT)
.should('not.exist')
cy.get('.dhis2-map').click('center') //Click somewhere on the map
cy.get('.dhis2-map').click('center') //Click in the middle of the map

cy.get('.maplibregl-popup').contains('Value: 0').should('be.visible')

Expand All @@ -159,7 +161,7 @@ context('Thematic Layers', () => {
cy.get('#dhis2-map-container')
.findByDataTest('dhis2-uicore-componentcover', EXTENDED_TIMEOUT)
.should('not.exist')
cy.get('.dhis2-map').click('center') //Click somewhere on the map
cy.get('.dhis2-map').click('center') //Click in the middle of the map

cy.get('.maplibregl-popup')
.contains('Value: No data')
Expand Down

0 comments on commit 0dc3e8c

Please sign in to comment.