-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Git hub actions: add watchdog to repeate unit tests once and issue au…
…to welcome
- Loading branch information
1 parent
b705b45
commit 4b2ef8f
Showing
2 changed files
with
70 additions
and
0 deletions.
There are no files selected for viewing
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,24 @@ | ||
name: "Welcome first-time issue contributor" | ||
|
||
on: | ||
issues: | ||
types: opened | ||
|
||
jobs: | ||
welcome-first-time-contributor: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- uses: plbstl/first-contribution@v3 | ||
with: | ||
labels: "Good first issue" | ||
issue-opened-msg: | | ||
### Hey @{fc-author} ! | ||
Looks like it's your first time interacting with Armbian here on GitHub. | ||
Welcome and thank you for taking the time to report an issue :heart:. | ||
Don't forget to star :star: the repo. |
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,46 @@ | ||
# | ||
# This action recreate action for building stable images | ||
# | ||
name: Watchdog (cronjob) | ||
on: | ||
schedule: | ||
- cron: '*/15 * * * *' | ||
workflow_dispatch: | ||
|
||
env: | ||
GH_TOKEN: ${{ secrets.ACCESS_TOKEN_ARMBIANWORKER }} | ||
|
||
concurrency: | ||
group: watchdog-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
|
||
gradle: | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 8 | ||
matrix: | ||
|
||
# list scripts you want to watch and execute failed jobs x-times | ||
script: ["unit-tests"] | ||
|
||
name: rerun | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: "Restart ${{ matrix.script }}.yml" | ||
run: | | ||
# Define variables here | ||
OWNER_REPO="armbian/configng" | ||
ATTEMPTS="2" | ||
SCRIPT="${{ matrix.script }}" | ||
WORKFLOW=$(gh api "/repos/${OWNER_REPO}/actions/workflows" | jq '.workflows[] | select(.path==".github/workflows/'${{ matrix.script }}'.yml")' | jq -r '.id') | ||
read ID STATUS ATTEMPT <<< $(gh api "/repos/${OWNER_REPO}/actions/workflows/${WORKFLOW}/runs" | jq '.workflow_runs[]' | jq -r '.id,.conclusion,.run_attempt' | head -3 | xargs -n3 -d'\n') | ||
# if attempt is lower then X and status is "cancelled" or "failed", rerun failed jobs | ||
if [ "${ATTEMPT}" -lt "${ATTEMPTS}" ] && ([ "$STATUS" == "failure" ] || [ "$STATUS" == "failure" ]); then | ||
gh api --method POST -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/${OWNER_REPO}/actions/runs/${ID}/rerun-failed-jobs | ||
fi |