Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update actions/upload-artifact from v3 to v4 to use the latest version. Also fix E2E test artifacts generation by configuring jest-html-reporters. #2180

Merged
merged 8 commits into from
Dec 27, 2024

Conversation

imanish003
Copy link
Contributor

@imanish003 imanish003 commented Dec 23, 2024

Fixes #

This PR updates the GitHub Actions workflow to use actions/upload-artifact@v4 instead of v3, as v3 will be deprecated on January 30, 2025.

GitHub has announced that artifact actions v3 will be closing down by January 30, 2025. After this date, using v3 of these actions will result in workflow failures.

The following workflows have been updated to use actions/upload-artifact@v4:

  1. JavaScript and CSS Linting workflow
    • Updated "Upload ESLint report step to use actions/upload-artifact@v4
  2. End-to-End Tests workflow
    • Updated the debug artifacts upload step to use actions/upload-artifact@v4

Additional changes

While testing changes made in this PR, I made two more changes:

  1. I have also updated "End-to-End Tests" workflow to use ubuntu-22.04 because of the issue mentioned in troubleshooting section. This was failing on Ubuntu 23.10+. Probably we can use some workarounds but for now, I have decided to use Ubuntu 22.04 to fix the issue.

  2. While testing "End-to-End Tests" workflow, I found that workflow wasn't generating any artifacts, even if tests were failing. I found out that we don't have reporters configured in package.json. I have added following to package.json to fix the issue.

"reporters": [
			"default",
			[
				"jest-html-reporters",
				{
					"publicPath": "./artifacts",
					"filename": "report.html"
				}
			]
		]

I also added jest-html-reporters to devDependencies in package.json.

Screenshots

How to test the changes in this Pull Request:

  1. Test "JavaScript and CSS Linting / Lint JavaScript" workflow

    • In this PR, verify that the workflow runs successfully
    • Verify that you can see file eslint_report.json in the "Artifacts" section of the workflow run
      image
  2. Test "End-to-End Tests" workflow

    • In this PR, verify that the workflow runs successfully and uploads debug artifacts using v4.
    • Testing generated HTML report
      • Create a pull request that triggers E2E tests.
      • Intentionally make a test fail to generate debug artifacts. For example, I tested in commit f9c3138.
      • Verify that failures-artifacts is available in the "Artifacts" section of the workflow run. Download and inspect the file to confirm it contains the expected content.

Changelog

Update actions/upload-artifact from v3 to v4 to use the latest version. Also fix E2E test artifacts generation by configuring jest-html-reporters.

@imanish003 imanish003 marked this pull request as draft December 23, 2024 11:36
@imanish003 imanish003 force-pushed the gh-actions-v4-migration branch from 244da71 to e939b57 Compare December 23, 2024 12:09
@imanish003 imanish003 force-pushed the gh-actions-v4-migration branch 4 times, most recently from 4897c4d to c5f9776 Compare December 23, 2024 13:15
@imanish003 imanish003 force-pushed the gh-actions-v4-migration branch from c5f9776 to cd240b5 Compare December 23, 2024 13:16
@imanish003 imanish003 changed the title Bump actions/upload-artifact from v3 to v4 Update actions/upload-artifact from v3 to v4 to use the latest version. Also fix E2E test artifacts generation by configuring jest-html-reporters. Dec 23, 2024
@imanish003 imanish003 added dependencies Pull requests that update a dependency file type: task The issue is an internally driven task (e.g. from another A8c team). labels Dec 23, 2024
@imanish003 imanish003 marked this pull request as ready for review December 23, 2024 13:58
@imanish003 imanish003 requested a review from Aljullu December 23, 2024 14:00
Copy link
Contributor

@Aljullu Aljullu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for working on this, @imanish003! 🙌

I tested it in #2181 and everything looks as expected. Code changes look good as well.

@github-actions github-actions bot added the status: ready to merge Automatically applied to a pull when a pull is approved. Indicates ready for merging. label Dec 27, 2024
@imanish003 imanish003 merged commit 09f8b6a into trunk Dec 27, 2024
7 checks passed
@imanish003 imanish003 deleted the gh-actions-v4-migration branch December 27, 2024 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file status: ready to merge Automatically applied to a pull when a pull is approved. Indicates ready for merging. type: task The issue is an internally driven task (e.g. from another A8c team).
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants