Update pmagpy (#153) #210
This file contains hidden or 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 Tests | |
on: | |
pull_request: | |
branches: [] | |
push: | |
branches: [] | |
tags: '*' | |
env: | |
PR_NUMBER: ${{ github.event.number }} | |
permissions: | |
# needed to allow julia-actions/cache to delete old caches that it has created | |
actions: write | |
contents: read | |
pull-requests: write | |
concurrency: | |
# Skip intermediate builds: always. | |
# Cancel intermediate builds: only if it is a pull request build. | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} | |
jobs: | |
test: | |
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash -el {0} | |
strategy: | |
fail-fast: false | |
matrix: | |
version: | |
- '1' | |
# - 'nightly' | |
python: | |
- 3.9 | |
os: | |
- ubuntu-latest | |
- macos-latest | |
arch: | |
- x64 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python 🐍 ${{ matrix.python }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python }} | |
- uses: julia-actions/setup-julia@v1 | |
with: | |
version: ${{ matrix.version }} | |
arch: ${{ matrix.arch }} | |
- uses: julia-actions/cache@v1 | |
with: | |
cache-registries: "true" | |
cache-compiled: "true" | |
- uses: julia-actions/julia-buildpkg@v1 | |
- uses: julia-actions/julia-runtest@v1 | |
- name: Performance benchmark | |
id: generate-comment | |
run: | | |
julia benchmark/run.jl > benchmark/results.txt | |
outTxt="$(cat benchmark/results.txt)" | |
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) | |
echo "comment<<$EOF" >> $GITHUB_OUTPUT | |
echo "$outTxt" >> $GITHUB_OUTPUT | |
echo "$EOF" >> $GITHUB_OUTPUT | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' | |
- name: Publish benchmark | |
uses: actions/github-script@v6 | |
if: matrix.os == 'ubuntu-latest' && github.event_name == 'pull_request' | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
script: | | |
github.rest.issues.createComment({ | |
issue_number: `${{ env.PR_NUMBER }}`, | |
owner: context.repo.owner, | |
repo: context.repo.repo, | |
body: `${{steps.generate-comment.outputs.comment}}` | |
}) | |
- uses: julia-actions/julia-processcoverage@v1 | |
- uses: codecov/codecov-action@v5 | |
with: | |
token: ${{secrets.CODECOV_TOKEN}} | |
files: lcov.info |