Skip to content

Commit

Permalink
use checkout twice and sparse checkout
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzierep committed Jul 11, 2024
1 parent e64db16 commit 8ff203f
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 49 deletions.
58 changes: 30 additions & 28 deletions .github/workflows/fetch_all_tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,31 +74,33 @@ jobs:
needs: fetch-all-tools-stepwise
name: Fetch all tools merge
steps:
- uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
name: checkout results
- run: |
git checkout results -- results
- uses: actions/setup-python@v5
- name: Install requirement
run: |
python -m pip install -r requirements.txt
sudo apt-get install jq
- 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}' results/repositories*.list_tools.tsv > results/all_tools.tsv
jq -s 'map(.[])' results/repositories*.list_tools.json > results/all_tools.json
- name: Wordcloud and interactive table
run: |
bash bin/format_tools.sh
- name: Commit all tools
# add or commit any changes in results if there was a change, merge with main and push as bot
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
- name: Install requirement
run: |
python -m pip install -r requirements.txt
sudo apt-get install jq
- 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}' results/repositories*.list_tools.tsv > results/all_tools.tsv
jq -s 'map(.[])' results/repositories*.list_tools.json > results/all_tools.json
- name: Wordcloud and interactive table
run: |
bash bin/format_tools.sh
- name: Commit all tools
# add or commit any changes in results if there was a change, merge with main and push as bot
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
39 changes: 27 additions & 12 deletions .github/workflows/filter_communities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,15 @@ jobs:
filter-all-tutorials:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand All @@ -53,10 +58,15 @@ jobs:
update-tools-to-keep-exclude:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand All @@ -78,10 +88,15 @@ jobs:
filter-all-tools:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand Down
26 changes: 18 additions & 8 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@ jobs:
runs-on: ubuntu-20.04
environment: fetch-tools
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
Expand All @@ -29,10 +34,15 @@ jobs:
test-tutorials:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main #pull latest code produced by job 1, not the revision that started the workflow (https://github.com/actions/checkout/issues/439)
- name: Checkout results
uses: actions/checkout@v4
with:
ref: results
sparse-checkout: results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
ref: 'results'
ref: results
- name: Setup Pages
uses: actions/configure-pages@v4
- name: Upload artifact
Expand Down

0 comments on commit 8ff203f

Please sign in to comment.