Merge branch '1.0' #110
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
name: Run unit tests | |
on: | |
push: | |
workflow_dispatch: | |
jobs: | |
RunTests-MacOSX-x86-64: | |
runs-on: macos-latest | |
env: | |
WOLFRAM_SYSTEM_ID: MacOSX-x86-64 | |
WOLFRAMENGINE_CACHE_KEY: WolframEngine-A | |
WOLFRAMENGINE_INSTALLATION_DIRECTORY: "/Applications/Wolfram Engine.app" | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Check out SpinWeightedSpheroidalHarmonics | |
uses: actions/checkout@v3 | |
with: | |
repository: BlackHolePerturbationToolkit/SpinWeightedSpheroidalHarmonics | |
ref: master | |
path: SpinWeightedSpheroidalHarmonics | |
- name: Check out KerrGeodesics | |
uses: actions/checkout@v3 | |
with: | |
repository: "BlackHolePerturbationToolkit/KerrGeodesics" | |
ref: master | |
path: KerrGeodesics | |
- name: Cache/restore Wolfram Engine install | |
id: cache-restore | |
uses: actions/cache@v3 | |
with: | |
path: ${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }} | |
key: wolframengine-${{ env.WOLFRAM_SYSTEM_ID }}-${{ env.WOLFRAMENGINE_CACHE_KEY }} | |
- name: Install Wolfram Engine | |
if: steps.cache-restore.outputs.cache-hit != 'true' | |
run: | | |
echo 'Installing Wolfram Engine...' | |
brew install --cask wolfram-engine | |
echo 'Installed Wolfram Engine.' | |
- name: Run unit tests | |
env: | |
WOLFRAMENGINE_EXECUTABLES_DIRECTORY: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/Resources/Wolfram Player.app/Contents/MacOS" | |
WOLFRAMSCRIPT_ENTITLEMENTID: ${{ secrets.WOLFRAM_LICENSE_ENTITLEMENT_ID }} | |
WOLFRAMSCRIPT_KERNELPATH: "${{ env.WOLFRAMENGINE_INSTALLATION_DIRECTORY }}/Contents/MacOS/WolframKernel" | |
run: | | |
export PATH="${{ env.WOLFRAMENGINE_EXECUTABLES_DIRECTORY }}:$PATH" | |
wolframscript -debug -verbose -script ./Tests/AllTests.wls | |
- name: Produce test report | |
id: testreport | |
uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: Unit tests | |
path: TestReport.xml | |
reporter: jest-junit | |
fail-on-error: false | |
- name: Extract branch name | |
shell: bash | |
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT | |
id: extract_branch | |
- name: Checkout gh-pages branch | |
uses: actions/checkout@v3 | |
with: | |
ref: gh-pages | |
path: gh-pages | |
- name: Generate the badge SVG image | |
uses: emibcn/badge-action@v1 | |
id: badge | |
with: | |
label: 'tests' | |
status: "${{ steps.testreport.outputs.passed }} passed, ${{ steps.testreport.outputs.failed }} failed, ${{ steps.testreport.outputs.skipped }} skipped" | |
color: ${{ | |
steps.testreport.outputs.failed == 0 && 'green' || | |
steps.testreport.outputs.failed > 0 && 'red' || | |
'yellow' }} | |
path: gh-pages/testresult.svg | |
- name: Commit badge | |
env: | |
BRANCH: ${{ steps.extract_branch.outputs.branch }} | |
FILE: 'testresult.svg' | |
working-directory: ./gh-pages | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
mkdir -p "badges/${BRANCH}" | |
mv "${FILE}" "badges/${BRANCH}" | |
git add "badges/${BRANCH}/${FILE}" | |
git commit -m "Add/Update badge" || true | |
- name: Push badge commit | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: gh-pages | |
directory: gh-pages |