|
1 | | -name: Filter community resources |
| 1 | +name: Community weekly resource filtering |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | workflow_dispatch: |
5 | | - # the workflow it also triggered when the community definitions are changed |
6 | 5 | push: |
| 6 | + branches: |
| 7 | + - 'main' |
| 8 | + - 'scorrear_PR_too_big' |
7 | 9 | paths: |
8 | | - - 'data/communities/*/metadata/*' |
9 | | - branches: ["main"] |
| 10 | + - 'communities/all/resources/tools.tsv' |
10 | 11 |
|
11 | 12 | # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. |
12 | 13 | # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. |
13 | 14 | concurrency: |
14 | | - group: "filter" |
| 15 | + group: "tools" |
15 | 16 | cancel-in-progress: false |
16 | 17 |
|
17 | 18 | jobs: |
18 | | - filter-resources: |
19 | | - name: Filter resources for communities |
| 19 | + set-matrix: |
20 | 20 | runs-on: ubuntu-latest |
| 21 | + outputs: |
| 22 | + communities: ${{ steps.prepare.outputs.communities }} |
21 | 23 | steps: |
22 | | - - name: Checkout main |
23 | | - uses: actions/checkout@v6 |
24 | | - - uses: actions/setup-python@v6 |
25 | | - with: |
26 | | - python-version: '3.11' |
27 | | - - name: Install requirement |
28 | | - run: python -m pip install -r requirements.txt |
29 | | - - name: Filter tutorials for communities |
30 | | - run: | |
31 | | - bash bin/get_community_tutorials.sh |
32 | | - - name: Update tool to keep and exclude for communities |
33 | | - run: | |
34 | | - bash bin/update_tools_to_keep_exclude.sh |
35 | | - - name: Filter tools for communities |
36 | | - run: | |
37 | | - bash bin/get_community_tools.sh |
38 | | - - name: Create Pull Request |
39 | | - uses: peter-evans/create-pull-request@v8 |
40 | | - with: |
41 | | - commit-message: Update resources |
42 | | - title: Resource filtering |
43 | | - body: Resource filering done via GitHub Action when the community definitions are changed |
44 | | - base: main |
45 | | - branch: resource-filtering |
46 | | - delete-branch: true |
| 24 | + - name: Checkout main |
| 25 | + uses: actions/checkout@v6 |
| 26 | + - name: Prepare communities JSON |
| 27 | + id: prepare |
| 28 | + run: | |
| 29 | + # produce a JSON array string, e.g. from a file or script |
| 30 | + echo '["assembly","biodiversity","earth","genome","imaging","machine-learning","metabolomics","microgalaxy","proteomics","spoc"]' > communities.json |
| 31 | + communities=$(cat communities.json) |
| 32 | + echo "communities=$communities" >> $GITHUB_OUTPUT |
| 33 | +
|
| 34 | + community-filter: |
| 35 | + needs: set-matrix |
| 36 | + runs-on: ubuntu-latest |
| 37 | + name: Filter resources and create labs |
| 38 | + strategy: |
| 39 | + matrix: |
| 40 | + community: ${{ fromJson(needs.set-matrix.outputs.communities) }} |
| 41 | + steps: |
| 42 | + - name: Checkout main |
| 43 | + uses: actions/checkout@v6 |
| 44 | + - uses: actions/setup-python@v6 |
| 45 | + with: |
| 46 | + python-version: '3.11' |
| 47 | + - name: Install requirement |
| 48 | + run: | |
| 49 | + python -m pip install -r requirements.txt |
| 50 | + sudo apt-get install jq |
| 51 | + - name: Filter tools for communities |
| 52 | + run: | |
| 53 | + bash sources/bin/get_community_tools.sh |
| 54 | + env: |
| 55 | + COMMUNITY: ${{ matrix.community }} |
| 56 | + - name: Filter workflows for communities |
| 57 | + run: | |
| 58 | + bash sources/bin/get_community_workflows.sh |
| 59 | + env: |
| 60 | + COMMUNITY: ${{ matrix.community }} |
| 61 | + - name: Filter tutorials for communities |
| 62 | + run: | |
| 63 | + bash sources/bin/get_community_tutorials.sh |
| 64 | + env: |
| 65 | + COMMUNITY: ${{ matrix.community }} |
| 66 | + - name: Filter citations for communities |
| 67 | + run: | |
| 68 | + bash sources/bin/get_community_citations.sh no-scholarly |
| 69 | + env: |
| 70 | + COMMUNITY: ${{ matrix.community }} |
| 71 | + #- name: Update tool to keep and exclude for communities |
| 72 | + # run: | |
| 73 | + # bash sources/bin/update_tools_to_keep_exclude.sh |
| 74 | + # env: |
| 75 | + # COMMUNITY: ${{ matrix.community }} |
| 76 | + - name: Populate lab for communities |
| 77 | + run: | |
| 78 | + bash sources/bin/populate_labs.sh |
| 79 | + env: |
| 80 | + COMMUNITY: ${{ matrix.community }} |
| 81 | + - name: Create Pull Request |
| 82 | + uses: peter-evans/create-pull-request@v8 |
| 83 | + with: |
| 84 | + commit-message: ${{ matrix.community }} community resources update |
| 85 | + title: ${{ matrix.community }} community automatic resources update |
| 86 | + body: ${{ matrix.community }} community automatic resource update done via GitHub Action once a week |
| 87 | + base: main |
| 88 | + branch: ${{ matrix.community }}-resource-update |
| 89 | + delete-branch: true |
| 90 | + add-paths: | |
| 91 | + communities/ |
0 commit comments