feat(scout): generalised scout functionality to check for discrepanci… #156
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: Continuous Integration | |
on: | |
push: | |
paths-ignore: | |
- 'docs/**' | |
branches: [ main ] | |
pull_request: | |
paths-ignore: | |
- 'docs/**' | |
branches: | |
- '**' | |
jobs: | |
Pre-commit-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Linting | |
run: | | |
pip install pre-commit | |
pre-commit run --all-files | |
Testing: | |
needs: pre-commit-checks | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Load cached venv | |
id: cached-poetry-dependencies | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~/.cache/pypoetry | |
key: poetry-${{ runner.os }}-${{ hashFiles('poetry.lock') }} | |
- name: Installation | |
run: | | |
pip install --upgrade pip | |
pip install poetry==1.2.2 | |
pip install vos | |
poetry config virtualenvs.create true | |
poetry config virtualenvs.in-project false | |
poetry config cache-dir ~/.cache/pypoetry | |
poetry config virtualenvs.path ~/.cache/pypoetry/venv | |
poetry install | |
- name: Create NETRC file | |
run: | | |
export CANFAR_NETRC_FILE=$RUNNER_TEMP"/CANFAR_NETRC" | |
echo ${{ secrets.CANFAR_NETRC }} > $CANFAR_NETRC_FILE | |
echo CANFAR_NETRC_FILE=$CANFAR_NETRC_FILE >> "$GITHUB_ENV" | |
- name: Obtain CADC certificate | |
run: | | |
export CADC_CERT=$HOME"/.ssl/cadcproxy.pem" | |
cadc-get-cert --netrc-file ${{ env.CANFAR_NETRC_FILE }} --days-valid 1 --cert-filename $CADC_CERT | |
echo CADC_CERT=$CADC_CERT >> "$GITHUB_ENV" | |
- name: Run Tests | |
run: | | |
poetry run pytest tests/ --cov . --cov-report=lcov --cov-report=xml | |
- name: Remove NETRC file and CADC certificate | |
run: | | |
echo "Removing file: "$CANFAR_NETRC_FILE | |
rm $CANFAR_NETRC_FILE | |
echo "Removing file: "$CADC_CERT | |
rm $CADC_CERT | |
- name: Upload coverage to Coveralls | |
uses: coverallsapp/github-action@v2 | |
with: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
path-to-lcov: "coverage.lcov" | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 | |
with: | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} |