-
Notifications
You must be signed in to change notification settings - Fork 96
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #223 from asogaard/icetray-action
Updating build-icetray action
- Loading branch information
Showing
2 changed files
with
52 additions
and
10 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
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 |
---|---|---|
|
@@ -13,20 +13,59 @@ on: | |
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
check-cobalt-credentials: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
has_credentials: ${{ steps.setvar.outputs.has_credentials }} | ||
steps: | ||
- name: Check secrets | ||
id: setvar | ||
run: | | ||
if [[ "${{ secrets.PUB_WISC_HOST }}" != "" && \ | ||
"${{ secrets.PUB_WISC_USERNAME }}" != "" && \ | ||
"${{ 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 | ||
check-codeclimate-credentials: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
has_credentials: ${{ steps.setvar.outputs.has_credentials }} | ||
steps: | ||
- name: Check secrets | ||
id: setvar | ||
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, check-codeclimate-credentials ] | ||
if: needs.check-cobalt-credentials.outputs.has_credentials == 'true' | ||
runs-on: ubuntu-latest | ||
container: icecube/icetray:combo-stable | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- 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 | ||
- name: Check secrets | ||
run: | | ||
echo "PUB_WISC_USERNAME=${{ 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 | ||
|
@@ -50,17 +89,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/[email protected] | ||
if: "${{ env.CC_TEST_REPORTER_ID != '' }} && ${{ env.PUB_WISC_USERNAME != '' }}" | ||
if: needs.check-codeclimate-credentials.outputs.has_credentials == 'true' | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ secrets.CODECLIMATE_TEST_REPORTER_ID }} | ||
with: | ||
|