Skip to content

Merge pull request #330 from byuccl/dependabot/submodules/third_party… #867

Merge pull request #330 from byuccl/dependabot/submodules/third_party…

Merge pull request #330 from byuccl/dependabot/submodules/third_party… #867

Workflow file for this run

name: Unit Tests
on:
push:
branches:
- main
pull_request:
# Cancel earlier jobs on new PR commit
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
# First list all the files in experiments/tests, and generate a JSON string of all the files
collect-experiments:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
# matrix-wip: ${{ steps.set-matrix-wip.outputs.matrix-wip }}
steps:
- uses: actions/checkout@v3
- id: set-matrix
run: |
echo "matrix=$(ls experiments/tests/*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
# - id: set-matrix-wip
# run: echo "matrix-wip=$(ls experiments/wip/*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
# Build a matrix run of all experiments generated in previous job
run-experiments:
needs: collect-experiments
runs-on: [self-hosted, linux]
strategy:
matrix:
experiment: ${{ fromJson(needs.collect-experiments.outputs.matrix) }}
steps:
- name: 'Cleanup build folder'
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v3
with:
token: ${{ secrets.GMT_TOOLS_PAT || github.token}}
submodules: 'recursive'
- uses: ./.github/actions/setup_env
with:
cache_path: $HOME/actions-runner/cache
- name: experiments
timeout-minutes: 40
run: |
source .venv/bin/activate
python scripts/bfasster.py --yaml ${{ matrix.experiment }}
- name: 'Create fname'
if: failure()
id: set-fname
run: echo "fname=$(basename ${{ matrix.experiment }} .yaml)" >> $GITHUB_OUTPUT
- name: 'Upload artifacts'
if: failure()
uses: actions/upload-artifact@v3
with:
name: ${{ steps.set-fname.outputs.fname }}
path: |
build/**/log.txt
build/**/*.log
unittest:
runs-on: [self-hosted, linux]
steps:
- name: 'Cleanup build folder'
run: |
ls -la ./
rm -rf ./* || true
rm -rf ./.??* || true
ls -la ./
- uses: actions/checkout@v3
with:
token: ${{ secrets.GMT_TOOLS_PAT || github.token}}
submodules: 'recursive'
- uses: ./.github/actions/setup_env
with:
cache_path: $HOME/actions-runner/cache
- name: Run unittest
run: |
make unittest
# Don't use WIP tests until Github UI is fixed (https://github.com/orgs/community/discussions/15452)
#
# run-experiments-wip:
# needs: collect-experiments
# runs-on: [self-hosted, linux]
# strategy:
# matrix:
# experiment: ${{ fromJson(needs.collect-experiments.outputs.matrix-wip) }}
# continue-on-error: true
# steps:
# - uses: actions/checkout@v3
# with:
# submodules: 'recursive'
# - uses: ./.github/actions/setup_env
# - name: experiments
# timeout-minutes: 30
# run: |
# source .venv/bin/activate
# source env.sh
# python scripts/run_experiment.py ${{ matrix.experiment }} -j8 --print_period 0