-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initialize and update workflow-triggered workflows status along the way
- Loading branch information
1 parent
351caf5
commit 6153cdf
Showing
3 changed files
with
107 additions
and
13 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 |
---|---|---|
|
@@ -24,10 +24,47 @@ on: | |
- cron: "38 11 */3 * *" | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
group: ${{ github.workflow }}-${{ github.event.push.head_commit.id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
initialize_e2e_tests_job_check: | ||
name: Initialize E2E Tests job checks | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Initialize Cypress E2E Tests job check | ||
id: initialize_cypress_e2e_tests_job_check | ||
uses: LouisBrunner/[email protected] | ||
with: | ||
conclusion: action_required | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: "Application E2E Tests (Cypress)" | ||
sha: ${{ github.event.push.head_commit.id }} | ||
status: queued | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Initialize Cypress E2E Tests job check | ||
id: initialize_puppeteer_e2e_tests_job_check | ||
uses: LouisBrunner/[email protected] | ||
with: | ||
conclusion: action_required | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: Application E2E Tests (Puppeteer) | ||
sha: ${{ github.event.push.head_commit.id }} | ||
status: queued | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Save job check IDs | ||
run: | | ||
mkdir -p workflow_share | ||
echo "${{ steps.initialize_cypress_e2e_tests_job_check.outputs.check_id }}" > workflow_share/cypress_job_check_id | ||
echo "${{ steps.initialize_puppeteer_e2e_tests_job_check.outputs.check_id }}" > workflow_share/puppeteer_job_check_id | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: workflow_share | ||
path: workflow_share/* | ||
|
||
build: | ||
name: Build and package | ||
runs-on: ubuntu-22.04 | ||
|
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 |
---|---|---|
|
@@ -21,6 +21,16 @@ jobs: | |
env: | ||
ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
steps: | ||
- name: Initialize job status check | ||
id: initialize_job_status_check | ||
uses: LouisBrunner/[email protected] | ||
with: | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: Application Deployment | ||
sha: ${{ github.event.push.head_commit.id }} | ||
status: in_progress | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Check Unit Tests status | ||
id: check_unit_tests_status | ||
uses: LASER-Yi/[email protected] | ||
|
@@ -50,6 +60,8 @@ jobs: | |
|
||
- name: Push docker image to registry | ||
if: ${{ steps.check_unit_tests_status.outputs.conclusion == 'success' }} | ||
continue-on-error: true | ||
id: push_docker_image | ||
run: | | ||
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${GITHUB_ACTOR} --password-stdin | ||
make docker-tag | ||
|
@@ -58,9 +70,9 @@ jobs: | |
- uses: LouisBrunner/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
# check_id: application-deployment-${{ github.event.workflow_run.head_commit.id }} | ||
conclusion: ${{ job.status }} | ||
check_id: ${{ steps.initialize_job_status_check.outputs.check_id }} | ||
conclusion: ${{ steps.push_docker_image.outcome }} | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: Application Deployment | ||
sha: ${{ github.event.workflow_run.head_commit.id }} | ||
status: completed | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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 |
---|---|---|
|
@@ -33,6 +33,25 @@ jobs: | |
PUPPETEER_SKIP_DOWNLOAD: "true" | ||
VITE_CYPRESS_PORT: 8880 | ||
steps: | ||
- name: "Download 'workflow_share' artifact" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: workflow_share | ||
|
||
- name: Set STATUS_CHECK_ID environment variable | ||
run: | | ||
echo "STATUS_CHECK_ID=$(cat workflow_share/cypress_job_check_id)" >> $GITHUB_ENV | ||
- name: Update job status check | ||
uses: LouisBrunner/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
check_id: ${{ env.STATUS_CHECK_ID }} | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
sha: ${{ github.event.workflow_run.head_commit.id }} | ||
status: in_progress | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -77,7 +96,10 @@ jobs: | |
firefox -v | ||
which firefox | ||
- uses: cypress-io/github-action@v6 | ||
- name: Run Cypress E2E tests | ||
id: run_cypress_e2e_tests | ||
continue-on-error: true | ||
uses: cypress-io/github-action@v6 | ||
with: | ||
browser: firefox | ||
config-file: config/cypress.config.ts | ||
|
@@ -89,14 +111,15 @@ jobs: | |
wait-on: "http://localhost:8880" | ||
working-directory: ./frontend | ||
|
||
- uses: LouisBrunner/[email protected] | ||
- name: set final job status check | ||
uses: LouisBrunner/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
# check_id: application-e2e-cypress-${{ github.event.workflow_run.head_commit.id }} | ||
conclusion: ${{ job.status }} | ||
check_id: ${{ env.STATUS_CHECK_ID }} | ||
conclusion: ${{ steps.run_cypress_e2e_tests.outcome }} | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: Application E2E Tests (Cypress) | ||
sha: ${{ github.event.workflow_run.head_commit.id }} | ||
status: completed | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
e2e_multi_windows_test: | ||
|
@@ -109,6 +132,25 @@ jobs: | |
PUPPETEER_SKIP_DOWNLOAD: "true" | ||
VITE_CYPRESS_PORT: 8880 | ||
steps: | ||
- name: "Download 'workflow_share' artifact" | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: workflow_share | ||
|
||
- name: Set STATUS_CHECK_ID environment variable | ||
run: | | ||
echo "STATUS_CHECK_ID=$(cat workflow_share/puppeteer_job_check_id)" >> $GITHUB_ENV | ||
- name: Update job status check | ||
uses: LouisBrunner/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
check_id: ${{ env.STATUS_CHECK_ID }} | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
sha: ${{ github.event.workflow_run.head_commit.id }} | ||
status: in_progress | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
|
@@ -150,15 +192,18 @@ jobs: | |
run: npx puppeteer browsers install firefox | ||
|
||
- name: Run multi-windows tests | ||
id: run_puppeteer_e2e_tests | ||
continue-on-error: true | ||
run: npm run test:multi-windows:run | ||
working-directory: ./frontend | ||
|
||
- uses: LouisBrunner/[email protected] | ||
- name: Set final job status check | ||
uses: LouisBrunner/[email protected] | ||
if: ${{ always() }} | ||
with: | ||
# check_id: application-e2e-puppeteer-${{ github.event.workflow_run.head_commit.id }} | ||
conclusion: ${{ job.status }} | ||
check_id: ${{ env.STATUS_CHECK_ID }} | ||
conclusion: ${{ steps.run_puppeteer_e2e_tests.outcome }} | ||
details_url: "https://github.com/MTES-MCT/monitorfish/actions/runs/${{ github.run_id }}/job/${{ github.job_id }}" | ||
name: Application E2E Tests (Puppeteer) | ||
sha: ${{ github.event.workflow_run.head_commit.id }} | ||
status: completed | ||
token: ${{ secrets.GITHUB_TOKEN }} |