Skip to content

Commit

Permalink
fetch results branch in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
paulzierep committed Jul 11, 2024
1 parent 81fbf6e commit 418544b
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 36 deletions.
19 changes: 11 additions & 8 deletions .github/workflows/fetch_all_tools.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,10 @@ jobs:
- 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: |
Expand All @@ -91,11 +95,10 @@ jobs:
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
run: |
git config user.name github-actions
git config user.email [email protected]
git pull --no-rebase -s recursive -X ours
git add results
git status
git diff --quiet && git diff --staged --quiet || (git commit -m "fetch all tools bot - step merge")
git push
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true
61 changes: 33 additions & 28 deletions .github/workflows/filter_communities.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,10 @@ jobs:
filter-all-tutorials:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand All @@ -39,19 +42,21 @@ jobs:
bash bin/get_community_tutorials.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
run: |
git config user.name github-actions
git config user.email [email protected]
git pull --no-rebase -s recursive -X ours
git add results
git status
git diff --quiet && git diff --staged --quiet || (git commit -m "fetch all tutorials / tools bot - step tutorial filter")
git push
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true

update-tools-to-keep-exclude:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand All @@ -62,19 +67,21 @@ jobs:
bash bin/update_tools_to_keep_exclude.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
run: |
git config user.name github-actions
git config user.email [email protected]
git pull --no-rebase -s recursive -X ours
git add results
git status
git diff --quiet && git diff --staged --quiet || (git commit -m "fetch all tutorials / tools bot - step exluded/kept tool list update")
git push
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true

filter-all-tools:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- uses: actions/setup-python@v5
with:
python-version: '3.8'
Expand All @@ -85,14 +92,12 @@ jobs:
bash bin/get_community_tools.sh
- name: Commit results
# commit the new filtered data, only if stuff was changed
run: |
git config user.name github-actions
git config user.email [email protected]
git pull --no-rebase -s recursive -X ours
git add results
git status
git diff --quiet && git diff --staged --quiet || (git commit -m "fetch all tools bot - step tool filter")
git push
uses: s0/git-publish-subdir-action@develop
env:
BRANCH: results
FOLDER: results
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPO: self
SKIP_EMPTY_COMMITS: true


6 changes: 6 additions & 0 deletions .github/workflows/run_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ jobs:
environment: fetch-tools
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
Expand All @@ -27,6 +30,9 @@ jobs:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4
name: checkout results
run: |
git checkout results -- results
- uses: actions/setup-python@v5
with:
python-version: '3.11'
Expand Down

0 comments on commit 418544b

Please sign in to comment.