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

Refactoring CI workflows #274

Merged
merged 1 commit into from
Sep 18, 2023
Merged

Refactoring CI workflows #274

merged 1 commit into from
Sep 18, 2023

Conversation

unkcpz
Copy link
Member

@unkcpz unkcpz commented Sep 16, 2023

  • plugins_metadata.json is created from scratch for preview and webpage deployment
  • In webpage build action, the cache of data JSON is used.
  • Duplication between preview and webpage build action, use workflow_run to deal with it.
  • Allow to run aiida-registry fetch locally.
  • preview action is depend on the CI.

@unkcpz unkcpz marked this pull request as draft September 16, 2023 21:26
@unkcpz unkcpz force-pushed the refac/xx/clean-up branch 16 times, most recently from dc8f043 to 504b420 Compare September 16, 2023 23:55
@github-actions
Copy link

github-actions bot commented Sep 17, 2023

PR Preview Action v1.4.4
🚀 Deployed preview to https://aiidateam.github.io/aiida-registry/pr-preview/pr-274/
on branch gh-pages at 2023-09-18 08:43 UTC

.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
@unkcpz unkcpz marked this pull request as ready for review September 17, 2023 00:39
@@ -1,28 +1,31 @@
name: CI
name: Comment on PRs with plugin metadata issues
Copy link
Member

@ltalirz ltalirz Sep 17, 2023

Choose a reason for hiding this comment

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

feel free to delete this file, it's no longer needed (ahmeds PR also deletes it)

Copy link
Member Author

Choose a reason for hiding this comment

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

I am not so sure. @Ahmed also mentioned preview is not able to be run by pr from forked repos but this one can. So we can keep it for the plugins developers for the moment?

Copy link
Member

Choose a reason for hiding this comment

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

I still think we should delete it, see my comment here #271 (comment)

Copy link
Member Author

Choose a reason for hiding this comment

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

That's fair! I'll remove it.

run: |
mv plugins_metadata.json aiida-registry-app/src/
cp plugins_metadata.json aiida-registry-app/src/
cp plugins_metadata.json aiida-registry-app/dist/
Copy link
Member

@ltalirz ltalirz Sep 17, 2023

Choose a reason for hiding this comment

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

npm run build does not already do that?
if not, I think one may need to add the json file in some app manifest (is this correct @AhmedBasem20 ?)

Copy link
Collaborator

Choose a reason for hiding this comment

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

npm run build does not already do that?

Yes it does. I think running mv command only will do the job. What you think @unkcpz ?

Copy link
Member Author

Choose a reason for hiding this comment

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

The second copy is for the code at

run: cp ./aiida-registry-app/src/plugins_metadata.json ./aiida-registry-app/dist
, was that needed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

In preview.yml, the file will not be on gh-pages without this step. However, it is not needed on webpage.yml. Not sure why🤷‍♂️

Copy link
Member

@ltalirz ltalirz 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 making the workflows more modular, much appreciated!

I haven't yet had time to follow the logic - if you would like feedback on something specific let me know

Comment on lines 18 to 23
- name: Restore cached Plugins
if: inputs.cache
id: cache-plugins-restore
uses: actions/cache/restore@v3
with:
path: plugins_metadata.json
key: plugins_metadata
Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks @ltalirz. This is not working as expected somehow, for the "preview" action, the cache is set the false and this step still runs and cause generate steps skipped. Do you have any idea why?

Copy link
Member

Choose a reason for hiding this comment

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

Sorry, I don't know the details of how the if conditions work

Copy link
Member Author

Choose a reason for hiding this comment

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

No worries, I think I find how to exit this rabbit hole. All because of this syntax issue of GitHub action actions/runner#1483 🥲

@@ -1,28 +1,31 @@
name: CI
name: Comment on PRs with plugin metadata issues
Copy link
Member Author

Choose a reason for hiding this comment

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

I am not so sure. @Ahmed also mentioned preview is not able to be run by pr from forked repos but this one can. So we can keep it for the plugins developers for the moment?

.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/workflows/ci.yml Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
.github/actions/generate-metadata/action.yml Outdated Show resolved Hide resolved
aiida_registry/cli.py Outdated Show resolved Hide resolved
.github/workflows/ci.yml Outdated Show resolved Hide resolved
aiida_registry/cli.py Outdated Show resolved Hide resolved
@unkcpz unkcpz force-pushed the refac/xx/clean-up branch 3 times, most recently from 11df398 to 7df3c76 Compare September 18, 2023 07:56
add build/ to gitignore

GITHUB_TOKEN not required when running locally

try use the new aiida-core image

Use reusable actions and refact CI workflow

use pyproject.toml

cache pip install

comment CI only for plugins.yaml

action

preview based on test-webpage-build
@unkcpz unkcpz merged commit 0b5cbb5 into master Sep 18, 2023
8 checks passed
@unkcpz unkcpz deleted the refac/xx/clean-up branch September 18, 2023 09:19
@unkcpz unkcpz mentioned this pull request Sep 18, 2023
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