Skip to content

Commit

Permalink
test install on push to main
Browse files Browse the repository at this point in the history
  • Loading branch information
j-i-l committed Jul 14, 2024
1 parent 616ce66 commit 9b84cb2
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 172 deletions.
46 changes: 3 additions & 43 deletions .github/workflows/onlabel_Fedora_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
name: Fedora Install

on:
pull_request:
types: [ labeled ]
push:
branches:
- "main"

env:
LABEL_CHECK: 'fedoraInstall::check'
LABEL_SUCCESS: 'fedoraInstall::passed'
LABEL_FAILURE: 'fedoraInstall::failed'
JAGS: '4.3.2'
BUILD_LOC: "./build"
BRANCH: ${{ github.head_ref || github.ref_name }}
Expand All @@ -25,7 +23,6 @@ jobs:
runs-on: ubuntu-latest
container:
image: "fedora:latest"
if: ${{ github.event.label.name == 'fedoraInstall::check' }}
name: fedora-latest R release
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -125,40 +122,3 @@ jobs:
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
shell: Rscript {0}

report_Fedora_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-installoutcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
46 changes: 3 additions & 43 deletions .github/workflows/onlabel_Macos_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
name: Macos Install

on:
pull_request:
types: [ labeled ]
push:
branches:
- "main"

env:
LABEL_CHECK: 'macosInstall::check'
LABEL_SUCCESS: 'macosInstall::passed'
LABEL_FAILURE: 'macosInstall::failed'
BUILD_LOC: "./build"
BRANCH: ${{ github.head_ref || github.ref_name }}

Expand All @@ -21,7 +19,6 @@ permissions:

jobs:
setup-and-install:
if: ${{ github.event.label.name == 'macosInstall::check' }}
name: macos-latest R release
runs-on: macos-latest
env:
Expand Down Expand Up @@ -95,40 +92,3 @@ jobs:
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
shell: Rscript {0}

report_Macos_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-install.outcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
46 changes: 3 additions & 43 deletions .github/workflows/onlabel_Ubuntu_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
name: Ubuntu Install

on:
pull_request:
types: [ labeled ]
push:
branches:
- "main"

env:
LABEL_CHECK: 'ubuntuInstall::check'
LABEL_SUCCESS: 'ubuntuInstall::passed'
LABEL_FAILURE: 'ubuntuInstall::failed'
JAGS: '4.3.2'
BUILD_LOC: "./build"
BRANCH: ${{ github.head_ref || github.ref_name }}
Expand All @@ -23,7 +21,6 @@ permissions:
jobs:
setup-and-install:
runs-on: ubuntu-latest
if: ${{ github.event.label.name == 'ubuntuInstall::check' }}
name: ubuntu-latest R release
env:
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }}
Expand Down Expand Up @@ -114,40 +111,3 @@ jobs:
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
shell: Rscript {0}

report_Ubuntu_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-installoutcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr
46 changes: 3 additions & 43 deletions .github/workflows/onlabel_Windows_setup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
name: Windows Install

on:
pull_request:
types: [ labeled ]
push:
branches:
- "main"

env:
LABEL_CHECK: 'windowsInstall::check'
LABEL_SUCCESS: 'windowsInstall::passed'
LABEL_FAILURE: 'windowsInstall::failed'
BUILD_LOC: "./build"
BRANCH: ${{ github.head_ref || github.ref_name }}
JAGS_MAJORV: '4'
Expand All @@ -24,7 +22,6 @@ permissions:

jobs:
setup-and-install:
if: ${{ github.event.label.name == 'windowsInstall::check' }}
name: windows-latest R release
runs-on: windows-latest
env:
Expand Down Expand Up @@ -97,40 +94,3 @@ jobs:
devtools::build(pkg = '.', path = '${{ env.BUILD_LOC }}/abn.tar.gz', vignettes = FALSE)
install.packages('${{ env.BUILD_LOC }}/abn.tar.gz', repos=NULL, type="source")
shell: Rscript {0}

report_Windows_setup:
if: ${{ (success() || failure()) }}
needs:
- setup-and-install
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
repository-projects: write
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
OWNER: ${{ github.repository_owner }}
REPO: ${{ github.event.repository.name }}
steps:
- uses: actions/checkout@v4
- name: Check if on demand tasks succeeded
run: |
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
if [ ${{ needs.setup-and-install.result }} == "success" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} passed! :rocket:" >> $GITHUB_STEP_SUMMARY
exit 0
elif [ ${{ needs.setup-and-install.result }} == "failure" ]; then
gh pr edit ${{ env.EVENT }} --remove-label ${{ env.LABEL_SUCCESS }} --repo ${{ env.OWNER }}/${{ env.REPO }}
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_FAILURE }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "### ${{ github.event.label.url }} failed!" >> $GITHUB_STEP_SUMMARY
exit 1
else
gh pr edit ${{ env.EVENT }} --add-label ${{ env.LABEL_CHECK }} --repo ${{ env.OWNER }}/${{ env.REPO }}
echo "On demand task outcome was ${{ needs.setup-and-install.outcome }}"
fi
shell: bash
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
EVENT: ${{ github.event.number }} # This is either the issue or pr

0 comments on commit 9b84cb2

Please sign in to comment.