1313
1414# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1515jobs :
16+
17+ check-cobalt-credentials :
18+ runs-on : ubuntu-latest
19+ outputs :
20+ has_credentials : ${{ steps.setvar.outputs.has_credentials }}
21+ steps :
22+ - name : Check secrets
23+ id : setvar
24+ run : |
25+ if [[ "${{ secrets.PUB_WISC_HOST }}" != "" && \
26+ "${{ secrets.PUB_WISC_USERNAME }}" != "" && \
27+ "${{ secrets.PUB_WISC_PASSWORD }}" != "" ]]; \
28+ then
29+ echo "Credentials to access Cobalt found"
30+ echo "::set-output name=has_credentials::true"
31+ else
32+ echo "Credentials to access Cobalt not found"
33+ echo "::set-output name=has_credentials::false"
34+ fi
35+
36+ check-codeclimate-credentials :
37+ runs-on : ubuntu-latest
38+ outputs :
39+ has_credentials : ${{ steps.setvar.outputs.has_credentials }}
40+ steps :
41+ - name : Check secrets
42+ id : setvar
43+ run : |
44+ if [[ "${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}" != "" ]]; \
45+ then
46+ echo "Credentials to access CodeClimate found"
47+ echo "::set-output name=has_credentials::true"
48+ else
49+ echo "Credentials to access CodeClimate not found"
50+ echo "::set-output name=has_credentials::false"
51+ fi
52+
1653 build-icetray :
54+ needs : [ check-cobalt-credentials, check-codeclimate-credentials ]
55+ if : needs.check-cobalt-credentials.outputs.has_credentials == 'true'
1756 runs-on : ubuntu-latest
1857 container : icecube/icetray:combo-stable
1958 steps :
2059 - uses : actions/checkout@v2
60+ - name : Upgrade packages already installed on icecube/icetray
61+ run : |
62+ pip install --upgrade astropy # Installed version incompatible with numpy 1.23.0 [https://github.com/astropy/astropy/issues/12534]
63+ pip install --ignore-installed PyYAML # Distutils installed [https://github.com/pypa/pip/issues/5247]
2164 - name : Install package
2265 uses : ./.github/actions/install-cpu
2366 with :
2467 editable : true
25- - name : Check secrets
26- run : |
27- echo "PUB_WISC_USERNAME=${{ secrets.PUB_WISC_USERNAME }}" >> $GITHUB_ENV
2868 - name : Retrieve test data
29- if : " ${{ env.PUB_WISC_USERNAME != '' }}"
3069 run : |
3170 # Create test data directory
3271 mkdir -p $TEST_DATA_DIR
@@ -50,17 +89,15 @@ jobs:
5089 MD5HASH : 80006a6d58338eb8ea153d2b7b02c0a1
5190 shell : bash
5291 - name : Run unit tests and generate coverage report
53- if : " ${{ env.PUB_WISC_USERNAME != '' }}"
5492 run : |
5593 coverage run --source=graphnet -m pytest tests/
5694 coverage xml -o coverage.xml
5795 - name : Work around permission issue
58- if : " ${{ env.PUB_WISC_USERNAME != '' }}"
5996 run : |
6097 git config --global --add safe.directory /__w/graphnet/graphnet
6198 - name : Publish code coverage
6299 uses : paambaati/codeclimate-action@v3.0.0
63- if : " ${{ env.CC_TEST_REPORTER_ID != '' }} && ${{ env.PUB_WISC_USERNAME != '' }} "
100+ if : needs.check-codeclimate-credentials.outputs.has_credentials == 'true'
64101 env :
65102 CC_TEST_REPORTER_ID : ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }}
66103 with :
0 commit comments