From cb4dc28ac59b2e42c8e5bfbe63498b0acccc242b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 09:40:32 +0200 Subject: [PATCH 01/23] Debug --- .github/workflows/build-icetray.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 43963408b..7eb37459e 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -18,6 +18,10 @@ jobs: container: icecube/icetray:combo-stable steps: - uses: actions/checkout@v2 + - name: Debug + run: | + pwd + ls -lart . - name: Install package uses: ./.github/actions/install-cpu with: From 7b3ef103b5757a5d54b44e4e623ebdb24e01e976 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 09:46:36 +0200 Subject: [PATCH 02/23] Debug --- .github/workflows/build-icetray.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 7eb37459e..06c6a668f 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -22,6 +22,8 @@ jobs: run: | pwd ls -lart . + ls -lart requirements/ + ls -lart requirements/torch_cpu.txt - name: Install package uses: ./.github/actions/install-cpu with: From b4366350dade6fdecfaed2c6929616ffeab892cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 09:52:27 +0200 Subject: [PATCH 03/23] Debug --- .github/workflows/build-icetray.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 06c6a668f..222c1df57 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -27,7 +27,7 @@ jobs: - name: Install package uses: ./.github/actions/install-cpu with: - editable: true + editable: false - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From aea2b11cf2bdf997a7ad87e399a7f94338160eb0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:07:43 +0200 Subject: [PATCH 04/23] Debug --- .github/workflows/build-icetray.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 222c1df57..3525ae6d0 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -27,7 +27,8 @@ jobs: - name: Install package uses: ./.github/actions/install-cpu with: - editable: false + editable: true + user: true - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From ea2f4504abdec0c0a0c1382a4f35312227266f70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:13:00 +0200 Subject: [PATCH 05/23] Debug --- .github/actions/install-cpu/action.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-cpu/action.yml b/.github/actions/install-cpu/action.yml index 4e3da9ee4..1d0324dd8 100644 --- a/.github/actions/install-cpu/action.yml +++ b/.github/actions/install-cpu/action.yml @@ -6,6 +6,10 @@ inputs: description: "Whether to install graphnet as editable" required: true default: false + user: + description: "Whether to install graphnet as user" + required: true + default: false extras: description: "Extras flags for pip installation of graphnet" required: true @@ -16,8 +20,9 @@ runs: steps: - name: Infer installation flags run: | - PIP_FLAGS=`[[ ${{ inputs.editable }} =~ (T|t)rue ]] && printf "%s\n" "-e" || echo " "` - echo "PIP_FLAGS=${PIP_FLAGS}" >> $GITHUB_ENV + PIP_FLAG_EDITABLE=`[[ ${{ inputs.editable }} =~ (T|t)rue ]] && printf "%s\n" "-e " || echo " "` + PIP_FLAG_USER=`[[ ${{ inputs.user }} =~ (T|t)rue ]] && printf "%s\n" "--user " || echo " "` + echo "PIP_FLAGS=${PIP_FLAG_EDITABLE}${PIP_FLAG_USER}" >> $GITHUB_ENV shell: bash - name: Install dependencies run: | From e8a334fd6f73070721f8923a7b02cd44c4514ac0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:29:18 +0200 Subject: [PATCH 06/23] Debug --- .github/actions/install-cpu/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-cpu/action.yml b/.github/actions/install-cpu/action.yml index 1d0324dd8..100fe63a7 100644 --- a/.github/actions/install-cpu/action.yml +++ b/.github/actions/install-cpu/action.yml @@ -22,7 +22,7 @@ runs: run: | PIP_FLAG_EDITABLE=`[[ ${{ inputs.editable }} =~ (T|t)rue ]] && printf "%s\n" "-e " || echo " "` PIP_FLAG_USER=`[[ ${{ inputs.user }} =~ (T|t)rue ]] && printf "%s\n" "--user " || echo " "` - echo "PIP_FLAGS=${PIP_FLAG_EDITABLE}${PIP_FLAG_USER}" >> $GITHUB_ENV + echo "PIP_FLAGS=${PIP_FLAG_USER}${PIP_FLAG_EDITABLE}" >> $GITHUB_ENV shell: bash - name: Install dependencies run: | @@ -31,5 +31,5 @@ runs: shell: bash - name: Install package run: | - pip install ${{ env.PIP_FLAGS }} -r requirements/torch_cpu.txt .${{ inputs.extras }} + pip install -r requirements/torch_cpu.txt ${{ env.PIP_FLAGS }} .${{ inputs.extras }} shell: bash From 1835b03f65895547d38a714e41e3a2e791ff0bc1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:35:22 +0200 Subject: [PATCH 07/23] Debug --- .github/workflows/build-icetray.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 3525ae6d0..06c6a668f 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -28,7 +28,6 @@ jobs: uses: ./.github/actions/install-cpu with: editable: true - user: true - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From 675a1e091b2e6da2e52499758d5d55e9e1e46b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:47:03 +0200 Subject: [PATCH 08/23] Debug --- .github/workflows/build-icetray.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 06c6a668f..9671b9e41 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -24,10 +24,14 @@ jobs: ls -lart . ls -lart requirements/ ls -lart requirements/torch_cpu.txt + - name: Update PATH + run: | + echo "PATH=~/.local/bin:$PATH" >> $GITHUB_ENV - name: Install package uses: ./.github/actions/install-cpu with: editable: true + user: true - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From 5384f7bae557450eebcbe741556fe0dcf423682c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 10:52:42 +0200 Subject: [PATCH 09/23] Debug --- .github/workflows/build-icetray.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 9671b9e41..0e23a53aa 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -26,12 +26,15 @@ jobs: ls -lart requirements/torch_cpu.txt - name: Update PATH run: | - echo "PATH=~/.local/bin:$PATH" >> $GITHUB_ENV + echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - name: Install package uses: ./.github/actions/install-cpu with: editable: true user: true + - name: Debug + run: | + ls -lart $HOME/.local/bin - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From 8d3de19c3b6dda0a976204a7c1da91df5662a5e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 11:18:21 +0200 Subject: [PATCH 10/23] Debug --- .github/workflows/build-icetray.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 0e23a53aa..db3e8c124 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -24,6 +24,7 @@ jobs: ls -lart . ls -lart requirements/ ls -lart requirements/torch_cpu.txt + pip list - name: Update PATH run: | echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV @@ -32,9 +33,9 @@ jobs: with: editable: true user: true - - name: Debug + - name: Upgrade astropy, already installed on icecube/icetray [https://github.com/astropy/astropy/issues/12534] run: | - ls -lart $HOME/.local/bin + pip install --user --upgrade astropy - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From 0debc7a70c0eecd8b56dcda410e2dfd33d450d0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 11:27:50 +0200 Subject: [PATCH 11/23] Remove debug statements --- .github/workflows/build-icetray.yml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index db3e8c124..ed090d896 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -18,14 +18,7 @@ jobs: container: icecube/icetray:combo-stable steps: - uses: actions/checkout@v2 - - name: Debug - run: | - pwd - ls -lart . - ls -lart requirements/ - ls -lart requirements/torch_cpu.txt - pip list - - name: Update PATH + - name: Update PATH to make scripts available, since we're installing graphnet as user run: | echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - name: Install package From 4be243921c47292db6ff7fa9e51d34dc52a7db3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 11:40:07 +0200 Subject: [PATCH 12/23] Switch away from user installation --- .github/workflows/build-icetray.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 62ac7fbbb..5a2861946 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -25,10 +25,10 @@ jobs: uses: ./.github/actions/install-cpu with: editable: true - user: true + user: false - name: Upgrade astropy, already installed on icecube/icetray [https://github.com/astropy/astropy/issues/12534] run: | - pip install --user --upgrade astropy + pip install --upgrade astropy - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From d72f3dd4c5fdabd63d0b2c8d0403de9932a82bd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 11:51:06 +0200 Subject: [PATCH 13/23] Upgrade PyYAML --- .github/workflows/build-icetray.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 5a2861946..b00b78908 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -26,9 +26,10 @@ jobs: with: editable: true user: false - - name: Upgrade astropy, already installed on icecube/icetray [https://github.com/astropy/astropy/issues/12534] + - name: Upgrade packages already installed on icecube/icetray run: | - pip install --upgrade astropy + pip install --upgrade astropy # Installed version incompatible with numpy 1.23.0 [https://github.com/astropy/astropy/issues/12534] + pip install --ignore-installed PyYAML # Distutils installed [https://github.com/pypa/pip/issues/5247] - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From ac8855245d2d096c7cd6a891e40322addaed78bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 11:55:27 +0200 Subject: [PATCH 14/23] Change order --- .github/workflows/build-icetray.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index b00b78908..c973726a7 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -21,15 +21,15 @@ jobs: - name: Update PATH to make scripts available, since we're installing graphnet as user run: | echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV + - name: Upgrade packages already installed on icecube/icetray + run: | + pip install --upgrade astropy # Installed version incompatible with numpy 1.23.0 [https://github.com/astropy/astropy/issues/12534] + pip install --ignore-installed PyYAML # Distutils installed [https://github.com/pypa/pip/issues/5247] - name: Install package uses: ./.github/actions/install-cpu with: editable: true user: false - - name: Upgrade packages already installed on icecube/icetray - run: | - pip install --upgrade astropy # Installed version incompatible with numpy 1.23.0 [https://github.com/astropy/astropy/issues/12534] - pip install --ignore-installed PyYAML # Distutils installed [https://github.com/pypa/pip/issues/5247] - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From bd589b721caa57836c845a2778f040aa5a4ca698 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:01:00 +0200 Subject: [PATCH 15/23] Remove update to PATH --- .github/workflows/build-icetray.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index c973726a7..2229d6d7d 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -18,9 +18,6 @@ jobs: container: icecube/icetray:combo-stable steps: - uses: actions/checkout@v2 - - name: Update PATH to make scripts available, since we're installing graphnet as user - run: | - echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV - name: Upgrade packages already installed on icecube/icetray run: | pip install --upgrade astropy # Installed version incompatible with numpy 1.23.0 [https://github.com/astropy/astropy/issues/12534] @@ -29,7 +26,6 @@ jobs: uses: ./.github/actions/install-cpu with: editable: true - user: false - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV From e4481f9efb50864d19c1993fad59a502d0c60596 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:18:44 +0200 Subject: [PATCH 16/23] Update if-statement --- .github/workflows/build-icetray.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 2229d6d7d..d5f70d1e8 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -29,6 +29,7 @@ jobs: - name: Check secrets run: | echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV + echo "CC_TEST_REPORTER_ID=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV - name: Retrieve test data if: "${{ env.PUB_WISC_USERNAME != '' }}" run: | @@ -64,7 +65,7 @@ jobs: git config --global --add safe.directory /__w/graphnet/graphnet - name: Publish code coverage uses: paambaati/codeclimate-action@v3.0.0 - if: "${{ env.CC_TEST_REPORTER_ID != '' }} && ${{ env.PUB_WISC_USERNAME != '' }}" + if: "${{ (env.PUB_WISC_USERNAME != '') && (env.CC_TEST_REPORTER_ID != '') }}" env: CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} with: From a56f19aa17ec3f4cf675335461f3ffe6ebc64ed4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:30:40 +0200 Subject: [PATCH 17/23] Make build-icetray conditional on cobalt credentials --- .github/workflows/build-icetray.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index d5f70d1e8..dba23103b 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -13,7 +13,27 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + has-cobalt-credentials: + name: Check if Cobalt credentials were set on secrets + runs-on: ubuntu-latest + outputs: + has_credentials: ${{ steps.setvar.outputs.has_credentials }} + steps: + - id: setvar + run: | + if [[ "${{ secrets.PUB_WISC_USERNAME }}" != "" && \ + "${{ secrets.secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ + then + echo "Credentials to access Cobalt found" + echo "::set-output name=has_credentials::true" + else + echo "Credentials to access Cobalt not found" + echo "::set-output name=has_credentials::false" + fi + build-icetray: + needs: [ has-cobalt-credentials ] + if: ${{ needs.has-cobalt-credentials.outputs.has_credentials == 'true' }} runs-on: ubuntu-latest container: icecube/icetray:combo-stable steps: From 692c62e53b79e2867900054ddc16c80ac220b679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:33:36 +0200 Subject: [PATCH 18/23] Update naming --- .github/workflows/build-icetray.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index dba23103b..19255c100 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -13,16 +13,16 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: - has-cobalt-credentials: - name: Check if Cobalt credentials were set on secrets + check-cobalt-credentials: + description: Check if Cobalt credentials were set on secrets runs-on: ubuntu-latest outputs: - has_credentials: ${{ steps.setvar.outputs.has_credentials }} + has-credentials: ${{ steps.setvar.outputs.has-credentials }} steps: - - id: setvar + - name: Check secrets run: | if [[ "${{ secrets.PUB_WISC_USERNAME }}" != "" && \ - "${{ secrets.secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ + "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ then echo "Credentials to access Cobalt found" echo "::set-output name=has_credentials::true" @@ -32,8 +32,8 @@ jobs: fi build-icetray: - needs: [ has-cobalt-credentials ] - if: ${{ needs.has-cobalt-credentials.outputs.has_credentials == 'true' }} + needs: [ check-cobalt-credentials ] + if: ${{ needs.check-cobalt-credentials.outputs.has-credentials == 'true' }} runs-on: ubuntu-latest container: icecube/icetray:combo-stable steps: From f96b74a0e33d925511c63f562addaf1382c95767 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:36:27 +0200 Subject: [PATCH 19/23] Update naming and add job for CodeClimate credentials --- .github/workflows/build-icetray.yml | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 19255c100..62374d55b 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -13,8 +13,8 @@ on: # A workflow run is made up of one or more jobs that can run sequentially or in parallel jobs: + check-cobalt-credentials: - description: Check if Cobalt credentials were set on secrets runs-on: ubuntu-latest outputs: has-credentials: ${{ steps.setvar.outputs.has-credentials }} @@ -25,14 +25,30 @@ jobs: "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ then echo "Credentials to access Cobalt found" - echo "::set-output name=has_credentials::true" + echo "::set-output name=has-credentials::true" else echo "Credentials to access Cobalt not found" - echo "::set-output name=has_credentials::false" + echo "::set-output name=has-credentials::false" + fi + + check-codeclimate-credentials: + runs-on: ubuntu-latest + outputs: + has-credentials: ${{ steps.setvar.outputs.has-credentials }} + steps: + - name: Check secrets + run: | + if [[ "${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}" != "" ]]; \ + then + echo "Credentials to access CodeClimate found" + echo "::set-output name=has-credentials::true" + else + echo "Credentials to access CodeClimate not found" + echo "::set-output name=has-credentials::false" fi build-icetray: - needs: [ check-cobalt-credentials ] + needs: [ check-cobalt-credentials, check-codeclimate-credentials ] if: ${{ needs.check-cobalt-credentials.outputs.has-credentials == 'true' }} runs-on: ubuntu-latest container: icecube/icetray:combo-stable @@ -85,7 +101,7 @@ jobs: git config --global --add safe.directory /__w/graphnet/graphnet - name: Publish code coverage uses: paambaati/codeclimate-action@v3.0.0 - if: "${{ (env.PUB_WISC_USERNAME != '') && (env.CC_TEST_REPORTER_ID != '') }}" + if: ${{ needs.check-codeclimate-credentials.outputs.has-credentials == 'true' }} env: CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} with: From 245161f957c799934b97aa2fa50d3229c1845da3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:38:55 +0200 Subject: [PATCH 20/23] Remove curly braces and unnecessary if-statements --- .github/workflows/build-icetray.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 62374d55b..4c8e5dab9 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -49,7 +49,7 @@ jobs: build-icetray: needs: [ check-cobalt-credentials, check-codeclimate-credentials ] - if: ${{ needs.check-cobalt-credentials.outputs.has-credentials == 'true' }} + if: needs.check-cobalt-credentials.outputs.has-credentials == 'true' runs-on: ubuntu-latest container: icecube/icetray:combo-stable steps: @@ -67,7 +67,6 @@ jobs: echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV echo "CC_TEST_REPORTER_ID=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV - name: Retrieve test data - if: "${{ env.PUB_WISC_USERNAME != '' }}" run: | # Create test data directory mkdir -p $TEST_DATA_DIR @@ -91,17 +90,15 @@ jobs: MD5HASH: 80006a6d58338eb8ea153d2b7b02c0a1 shell: bash - name: Run unit tests and generate coverage report - if: "${{ env.PUB_WISC_USERNAME != '' }}" run: | coverage run --source=graphnet -m pytest tests/ coverage xml -o coverage.xml - name: Work around permission issue - if: "${{ env.PUB_WISC_USERNAME != '' }}" run: | git config --global --add safe.directory /__w/graphnet/graphnet - name: Publish code coverage uses: paambaati/codeclimate-action@v3.0.0 - if: ${{ needs.check-codeclimate-credentials.outputs.has-credentials == 'true' }} + if: needs.check-codeclimate-credentials.outputs.has-credentials == 'true' env: CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} with: From 1fd2249727650fddf2d0395c3da1a3d543cdea49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:40:08 +0200 Subject: [PATCH 21/23] Switch to underscore --- .github/workflows/build-icetray.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 4c8e5dab9..bee66e0d9 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -17,7 +17,7 @@ jobs: check-cobalt-credentials: runs-on: ubuntu-latest outputs: - has-credentials: ${{ steps.setvar.outputs.has-credentials }} + has_credentials: ${{ steps.setvar.outputs.has_credentials }} steps: - name: Check secrets run: | @@ -25,31 +25,31 @@ jobs: "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ then echo "Credentials to access Cobalt found" - echo "::set-output name=has-credentials::true" + echo "::set-output name=has_credentials::true" else echo "Credentials to access Cobalt not found" - echo "::set-output name=has-credentials::false" + echo "::set-output name=has_credentials::false" fi check-codeclimate-credentials: runs-on: ubuntu-latest outputs: - has-credentials: ${{ steps.setvar.outputs.has-credentials }} + has_credentials: ${{ steps.setvar.outputs.has_credentials }} steps: - name: Check secrets run: | if [[ "${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}" != "" ]]; \ then echo "Credentials to access CodeClimate found" - echo "::set-output name=has-credentials::true" + echo "::set-output name=has_credentials::true" else echo "Credentials to access CodeClimate not found" - echo "::set-output name=has-credentials::false" + echo "::set-output name=has_credentials::false" fi build-icetray: needs: [ check-cobalt-credentials, check-codeclimate-credentials ] - if: needs.check-cobalt-credentials.outputs.has-credentials == 'true' + if: needs.check-cobalt-credentials.outputs.has_credentials == 'true' runs-on: ubuntu-latest container: icecube/icetray:combo-stable steps: @@ -98,7 +98,7 @@ jobs: git config --global --add safe.directory /__w/graphnet/graphnet - name: Publish code coverage uses: paambaati/codeclimate-action@v3.0.0 - if: needs.check-codeclimate-credentials.outputs.has-credentials == 'true' + if: needs.check-codeclimate-credentials.outputs.has_credentials == 'true' env: CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} with: From fb14d94aeb4c0c6a142ff80f32c5330b262d8cc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:42:04 +0200 Subject: [PATCH 22/23] Map output of step to output of job --- .github/workflows/build-icetray.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index bee66e0d9..84f756371 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -20,6 +20,7 @@ jobs: has_credentials: ${{ steps.setvar.outputs.has_credentials }} steps: - name: Check secrets + id: setvar run: | if [[ "${{ secrets.PUB_WISC_USERNAME }}" != "" && \ "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ @@ -37,6 +38,7 @@ jobs: has_credentials: ${{ steps.setvar.outputs.has_credentials }} steps: - name: Check secrets + id: setvar run: | if [[ "${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}" != "" ]]; \ then From 4049faec912397e11ff7f7ce1121712b5d9e1f7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20S=C3=B8gaard?= Date: Thu, 23 Jun 2022 12:50:07 +0200 Subject: [PATCH 23/23] Add another secret to check, and remove unused step --- .github/workflows/build-icetray.yml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build-icetray.yml b/.github/workflows/build-icetray.yml index 84f756371..f85afcdbf 100644 --- a/.github/workflows/build-icetray.yml +++ b/.github/workflows/build-icetray.yml @@ -22,7 +22,8 @@ jobs: - name: Check secrets id: setvar run: | - if [[ "${{ secrets.PUB_WISC_USERNAME }}" != "" && \ + if [[ "${{ secrets.PUB_WISC_HOST }}" != "" && \ + "${{ secrets.PUB_WISC_USERNAME }}" != "" && \ "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \ then echo "Credentials to access Cobalt found" @@ -64,10 +65,6 @@ jobs: uses: ./.github/actions/install-cpu with: editable: true - - name: Check secrets - run: | - echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV - echo "CC_TEST_REPORTER_ID=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV - name: Retrieve test data run: | # Create test data directory