Skip to content

[skip changelog] Build is now uploaded as artifact when running tests workflow #877

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

Merged
merged 5 commits into from
Aug 4, 2020

Conversation

silvanocerza
Copy link
Contributor

  • The PR has no duplicates (please search among the Pull Requests
    before creating one)
  • The PR follows our contributing guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features)

When running the test.yaml workflow successfully a build artifact is uploaded to ease testing of new features and PR changes.


See how to contribute

@silvanocerza silvanocerza requested a review from a team July 28, 2020 09:24
@silvanocerza silvanocerza self-assigned this Jul 28, 2020
@silvanocerza silvanocerza force-pushed the scerza/test-artifact branch from 72e3860 to 311a143 Compare July 28, 2020 16:10
Copy link
Contributor

@per1234 per1234 left a comment

Choose a reason for hiding this comment

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

Thanks Silvano! I think this is really important because it enables any community member to participate in beta testing and reviewing PRs by removing the requirement of getting set up to build Arduino CLI locally.


Is it possible to have a separate artifact for each OS, so you can just download the one you need? I see evidence to the contrary here, but I didn't look into that closely so I don't know if the same restrictions apply here.


There are currently duplicates of everything in the artifact:

dist
├── 0.11.0-rc1-20200730-checksums.txt
├── arduino_cli_arm64_linux_arm64
│   └── arduino-cli
├── arduino_cli_arm_linux_arm_6
│   └── arduino-cli
├── arduino_cli_armv7_linux_arm_7
│   └── arduino-cli
├── arduino_cli_linux_386
│   └── arduino-cli
├── arduino_cli_linux_amd64
│   └── arduino-cli
├── arduino_cli_osx_darwin_amd64
│   └── arduino-cli
├── arduino-cli_test-20200730_Linux_32bit.tar.gz
├── arduino-cli_test-20200730_Linux_64bit.tar.gz
├── arduino-cli_test-20200730_Linux_ARM64.tar.gz
├── arduino-cli_test-20200730_Linux_ARMv6.tar.gz
├── arduino-cli_test-20200730_Linux_ARMv7.tar.gz
├── arduino-cli_test-20200730_macOS_64bit.tar.gz
├── arduino-cli_test-20200730_Windows_32bit.zip
├── arduino-cli_test-20200730_Windows_64bit.zip
├── arduino_cli_windows_386
│   └── arduino-cli.exe
├── arduino_cli_windows_amd64
│   └── arduino-cli.exe
├── config.yaml
└── LICENSE.txt

So I would recommend adding a step to clean out the copies before uploading the artifact.


I think it would be really nice for the folders or archive file names (whichever ends up being kept for the artifact after the clean up) of each of the Arduino CLI builds to contain identifying information:

  • PR number (if event is pull_request)
  • Commit ref (for PRs as well as pushes to identify which build of the PR the artifact is for when there have been multiple pushes to the PR)

The reason is because I will often have multiple test builds of software from various PRs on my computer and if they aren't clearly identified it gets confusing. Yes, I can use arduino-cli version to get the ref, but that is less convenient and ends up taking you on a bit of a convoluted path to find the PR due to the ref being for the merge commit (example.

@silvanocerza
Copy link
Contributor Author

Yeah, I think it should be possible to upload separate artifacts for each OS but I'd need to check to be 100% sure.
Adding identifying information is certainly doable, I'll see to do it.

@silvanocerza
Copy link
Contributor Author

I've done some changes, now only the archives and the checksums are pushed, this is what is inside the dist artifact:

0.11.0-rc1-62-g72c9655f-20200731-checksums.txt
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Linux_32bit.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Linux_64bit.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Linux_ARM64.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Linux_ARMv6.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Linux_ARMv7.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_macOS_64bit.tar.gz
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Windows_32bit.zip
arduino-cli_test-877-8e751dcf63f4cdb7b77bbc89ff78184a4e8aea53-20200731_Windows_64bit.zip

The archives names have this format arduino-cli_<workflow_name>-<pr_number>-<commit_hash>-<date>_<platform>, the PR number is there only if the workflow is triggered by a PR.

Pushing one artifact for each platform is doable but not exactly the most elegant thing, the upload-artifact action doesn't give the possibility to do it, we'd need a step for each platform or write some custom script to use the GH API.

Copy link
Contributor

@rsora rsora left a comment

Choose a reason for hiding this comment

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

🛠️

@per1234
Copy link
Contributor

per1234 commented Jul 31, 2020

we'd need a step for each platform

IMO, it's worth it. It will be very rare that we change the supported platforms, so it doesn't represent any significant maintenance burden. The steps are in a separate job, so they wouldn't harm the log readability.

My understanding is that the purpose of this feature is to make beta testing easy for the people for whom building from source represents a significant barrier. Being able to provide a link to a small download that provides only the file needed for their specific platform is in that spirit. It's common for people to get confused by ARM vs regular Linux and 64 vs 32 bits.

@silvanocerza silvanocerza merged commit bd6c861 into master Aug 4, 2020
@silvanocerza silvanocerza deleted the scerza/test-artifact branch August 4, 2020 11:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants