Update for Airflow 2.6.3 (#167) #1161
Workflow file for this run
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: Unit Tests | |
on: [push] | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
max-parallel: 4 | |
matrix: | |
python-version: [3.8] | |
os: [ubuntu-20.04] | |
steps: | |
- name: Checkout ${{ matrix.python-version }} | |
uses: actions/checkout@v2 | |
with: | |
lfs: true | |
- name: Set up Python ${{ matrix.python-version }} | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies # TODO: checkout observatory platform from same branch, e.g. develop or master | |
run: | | |
python -m pip install --upgrade pip | |
cd .. | |
git clone https://github.com/The-Academic-Observatory/observatory-platform.git | |
cd observatory-platform | |
pip install -e observatory-api --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt | |
pip install -e observatory-platform --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt | |
cd .. | |
cd oaebu-workflows | |
pip install -e .[tests] --constraint https://raw.githubusercontent.com/apache/airflow/constraints-2.6.3/constraints-no-providers-${{ matrix.python-version }}.txt | |
# Required for testing ONIX Telescope | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v2 | |
with: | |
java-version: "11" | |
distribution: "adopt" | |
- name: Check licenses | |
run: | | |
# stop the build if there are licensing issues | |
liccheck --sfile strategy.ini --rfile requirements.txt --level CAUTIOUS --reporting liccheck-output.txt --no-deps | |
- name: Lint with flake8 | |
run: | | |
# stop the build if there are Python syntax errors or undefined names | |
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | |
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | |
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics | |
- name: Run unit tests with coverage | |
env: | |
TEST_GCP_DATA_LOCATION: ${{ secrets.TEST_GCP_DATA_LOCATION }} | |
TEST_GCP_PROJECT_ID: ${{ secrets.TEST_GCP_PROJECT_ID }} | |
TEST_GCP_SERVICE_KEY: ${{ secrets.TEST_GCP_SERVICE_KEY }} | |
GOOGLE_APPLICATION_CREDENTIALS: /tmp/google_application_credentials.json | |
AIRFLOW__CORE__LOAD_EXAMPLES: false | |
run: | | |
echo "${TEST_GCP_SERVICE_KEY}" | base64 --decode > /tmp/google_application_credentials.json | |
coverage run -m unittest discover -v | |
coverage xml | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v1 | |
with: | |
file: ./coverage.xml | |
fail_ci_if_error: false |