-
Notifications
You must be signed in to change notification settings - Fork 16
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
Restructuration for community content #169
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4eb13c2
Restructure the repository content:
bebatut d209643
Reorganize GitHub action workflows
bebatut 051460a
Adapt CRON workflow to limit the subset jobs to a job and use artifac…
bebatut 0c7a9b7
Update .github/workflows/fetch_filter_resources.yaml
bebatut File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,121 @@ | ||
name: Weekly resource fetching and community filtering | ||
|
||
on: | ||
workflow_dispatch: | ||
schedule: | ||
#Every Sunday at 8:00 am | ||
- cron: "0 8 * * 0" | ||
|
||
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. | ||
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. | ||
concurrency: | ||
group: "tools" | ||
cancel-in-progress: false | ||
|
||
jobs: | ||
fetch-servers: | ||
runs-on: ubuntu-20.04 | ||
name: Merge tools, fetch tutorials and filter the resources for communities | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install requirement | ||
run: | | ||
python -m pip install -r requirements.txt | ||
sudo apt-get install jq | ||
- name: Fetch list of all available servers | ||
run: | | ||
python sources/bin/get_public_galaxy_servers.py -o sources/data/available_public_servers.csv | ||
- name: Archive available servers | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: available-servers | ||
path: sources/data/available_public_servers.csv | ||
fetch-tools-stepwise: | ||
runs-on: ubuntu-20.04 | ||
name: Fetch tool stepwise | ||
strategy: | ||
#max-parallel: 1 #need to run one after another, since otherwise there is a chance, that mulitple jobs want to push to the results branch at the same time (which fails due to merge) | ||
matrix: | ||
python-version: [3.11] | ||
subset: | ||
- repositories01.list | ||
- repositories02.list | ||
- repositories03.list | ||
- repositories04.list | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install requirement | ||
run: python -m pip install -r requirements.txt | ||
- name: Download a single artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: available-servers | ||
path: sources/data/ | ||
- name: Fetch all tool stepwise | ||
run: | | ||
bash sources/bin/extract_all_tools.sh "${{ matrix.subset }}" | ||
env: | ||
GITHUB_API_KEY: ${{ secrets.GH_API_TOKEN }} | ||
- name: Archive tool sublists production artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: tools-${{ matrix.subset }} | ||
path: communities/all/resources/repositories${{ matrix.subset }}.list_tools.tsv | ||
merge-fetch-filter: | ||
runs-on: ubuntu-20.04 | ||
name: Merge tools, fetch tutorials and filter the resources for communities | ||
steps: | ||
- name: Checkout main | ||
uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- name: Install requirement | ||
run: | | ||
python -m pip install -r requirements.txt | ||
sudo apt-get install jq | ||
- name: Download All Artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: tools | ||
pattern: tools-* | ||
merge-multiple: true | ||
path: communities/all/resources/ | ||
- name: Merge all tools | ||
run: | #merge files with only one header -> https://stackoverflow.com/questions/16890582/unixmerge-multiple-csv-files-with-same-header-by-keeping-the-header-of-the-firs; map(.[]) -> https://stackoverflow.com/questions/42011086/merge-arrays-of-json (get flat array, one tool per entry) | ||
awk 'FNR==1 && NR!=1{next;}{print}' communities/all/resources/repositories*.list_tools.tsv > communities/all/resources/tools.tsv | ||
jq -s 'map(.[])' communities/all/resources/repositories*.list_tools.json > communities/all/resources/all_tools.json | ||
- name: Generate wordcloud and interactive table | ||
run: | | ||
bash sources/bin/format_tools.sh | ||
- name: Fetch all tutorials | ||
run: | | ||
bash bin/extract_all_tutorials.sh | ||
env: | ||
PLAUSIBLE_API_KEY: ${{ secrets.PLAUSIBLE_API_TOKEN }} | ||
- name: Filter tutorials for communities | ||
run: | | ||
bash bin/get_community_tutorials.sh | ||
- name: Update tool to keep and exclude for communities | ||
run: | | ||
bash bin/update_tools_to_keep_exclude.sh | ||
- name: Filter tools for communities | ||
run: | | ||
bash bin/get_community_tools.sh | ||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v4 | ||
with: | ||
commit-message: Update resources | ||
title: Automatic resources update | ||
body: Automatic resource update done via GitHub Action once a week | ||
base: main | ||
branch: resource-update | ||
delete-branch: true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This combined WF triggers a subset job, where each repositories*.list is processed individually. The way it's now combined, everything after the merge part does not really make sense ... and the
Fetch list of all available servers
should probably also not be a part of the matrix subset. I would propose to run theFetch all tool stepwise
in an individual job and store the results as an artifact. Then use the artifact as input for the merge part and have that as another job.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adapted the CRON workflow to have 3 jobs