Skip to content

Connect to Rubin's test stream (#123) #77

Connect to Rubin's test stream (#123)

Connect to Rubin's test stream (#123) #77

name: Test Cloud Functions
on:
workflow_dispatch:
push:
jobs:
run_tests:
name: Test Service
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11"]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install requirements
run: |
if [ -f "requirements.txt" ];
then
pip install -r requirements.txt
else:
echo "No requirements file found."
fi
- name: Install coverage tool
run: pip install coverage
- name: Run tests with coverage
run: |
coverage run -m unittest
coverage xml -o report_${{ matrix.python-version }}.xml
coverage report
# Report test coverage to codacy for the current set of tests
- name: Report partial coverage results
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) report --partial -l Python -r report_${{ matrix.python-version }}.xml
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}
codacy-coverage-reporter:
name: Report code coverage
runs-on: ubuntu-latest
needs: python_tests

Check failure on line 54 in .github/workflows/TestCloudFunction.yml

View workflow run for this annotation

GitHub Actions / Test Cloud Functions

Invalid workflow file

The workflow is not valid. .github/workflows/TestCloudFunction.yml (Line: 54, Col: 12): Job 'codacy-coverage-reporter' depends on unknown job 'python_tests'.
steps:
# Tell codacy we are done reporting test coverage
- name: Finish reporting coverage
run: bash <(curl -Ls https://coverage.codacy.com/get.sh) final
env:
CODACY_PROJECT_TOKEN: ${{ secrets.CODACY_PROJECT_TOKEN }}