Connect to Rubin's test stream (#123) #77
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: 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 GitHub Actions / Test Cloud FunctionsInvalid workflow file
|
||
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 }} |