Run Tests and OPUS: branch 57/merge by juzen2003 #71
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 Tests and OPUS | |
run-name: "Run Tests and OPUS: ${{ github.ref_type }} ${{ github.ref_name }} by ${{ github.triggering_actor }}" | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: [ main ] | |
defaults: | |
run: | |
shell: bash | |
jobs: | |
test_pdsfile: | |
name: Test pdsfile | |
uses: ./.github/workflows/run-tests.yml | |
test_opus: | |
name: Test pdsfile via OPUS | |
needs: [test_pdsfile] | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
# We only need to test the platforms, not the Python versions | |
include: | |
- os: self-hosted-linux | |
python-version: "3.12" | |
- os: self-hosted-macos | |
python-version: "3.12" | |
- os: self-hosted-windows | |
python-version: "3.12" | |
fail-fast: true | |
steps: | |
- name: Checkout rms-pdsfile | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.event.pull_request.head.sha }} | |
- name: Checkout rms-opus | |
uses: actions/checkout@v4 | |
with: | |
repository: SETI/rms-opus | |
path: rms-opus | |
# ref: rf240417_ring_names | |
# Currently we just checkout the current master branch for OPUS. | |
# We really need some way to specify a branch so that we can do | |
# parallel inter-dependent development on PdsFile and OPUS. | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Test with coverage | |
# Because self-hosted runners keep a global Python environment that | |
# isn't wiped between runs, the various requirements.txt files will | |
# interfere with each other. As a result, we use a venv for cases | |
# where it matters. | |
run: | | |
cd $GITHUB_WORKSPACE/rms-opus | |
echo | |
env | |
echo | |
rm -rf venv | |
python -m venv venv | |
if [[ ${{ matrix.os }} == self-hosted-windows ]]; then | |
source venv/Scripts/activate | |
else | |
source venv/bin/activate | |
fi | |
python -m pip install --upgrade pip | |
python -m pip install wheel | |
python -m pip install -r requirements.txt | |
python -m pip uninstall -y rms-pdsfile | |
python -m pip install -e $GITHUB_WORKSPACE | |
echo | |
python -m pip freeze | |
echo | |
scripts/automated_tests/opus_main_test.sh | |
- name: Check coverage level | |
run: | | |
cd $GITHUB_WORKSPACE/rms-opus | |
scripts/automated_tests/opus_check_coverage.sh |