diff --git a/.github/workflows/antivirus.yml b/.github/workflows/antivirus.yml new file mode 100644 index 00000000..25b1d9bf --- /dev/null +++ b/.github/workflows/antivirus.yml @@ -0,0 +1,14 @@ +on: + pull_request: + types: [assigned, opened, synchronize, reopened, closed] + +jobs: + gitavscan: + runs-on: ubuntu-latest + name: AV scan + steps: + - uses: actions/checkout@v3 + - name: Git AV Scan + uses: djdefi/gitavscan@main + with: + full: '--full' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 5d14da72..d8cdcef1 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -13,13 +13,17 @@ name: "CodeQL" on: push: - branches: [ master ] + branches: [ main ] pull_request: # The branches below must be a subset of the branches above - branches: [ master ] + branches: [ main ] schedule: - cron: '37 14 * * 4' +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: analyze: name: Analyze diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 9f1e2850..c7725c81 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,14 +1,20 @@ name: Build and Deploy + on: push: branches: - master + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build-and-deploy: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] + python-version: ["3.10"] steps: - name: Checkout 🛎️ uses: actions/checkout@v2.3.1 diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 941a4eb0..7dcbf405 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -1,37 +1,57 @@ -name: RadTRAQ +name: Python Package using Conda on: + push: + branches: [ main ] pull_request: - types: [assigned, opened, synchronize, reopened, closed] + branches: [ main ] + +# Cancel concurrent runs +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true jobs: build: - - runs-on: ubuntu-latest + name: ${{ matrix.os }}-${{ matrix.python-version }} + if: github.repository == 'ARM-Development/RadTraQ' + runs-on: ${{ matrix.os }}-latest + defaults: + run: + shell: bash -l {0} strategy: - max-parallel: 4 + fail-fast: false matrix: - python-version: [3.7] + python-version: ["3.7", "3.8", "3.9"] + os: [macOS, ubuntu, Windows] + inlcude: + - os: macos-latest + PLAT: arm64 + INTERFACE64: "" + platform: [x64] steps: - - uses: actions/checkout@v1 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - sudo apt-get install libproj-dev proj-data proj-bin - sudo apt-get install libgeos-dev - pip install --upgrade cython numpy pyshp six - pip install -r requirements.txt - - name: Lint with flake8 - run: | - pip install flake8 - flake8 --max-line-length=115 --ignore=F401,E402,W504,W605,F403 - - name: Test with pytest - run: | - python setup.py install - pip install pytest - pytest + - uses: actions/checkout@v2 + + - name: Setup Conda Environment + uses: conda-incubator/setup-miniconda@v2 + with: + python-version: ${{ matrix.python-version }} + environment-file: ./continuous_integration/environment_actions.yml + activate-environment: radtraq_env + auto-activate-base: False + mamba-version: '*' + use-mamba: true + miniforge-variant: Mambaforge + + - 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 + # Switching back to original flake + python -m flake8 --max-line-length=127 --ignore=F401,E402,W504,W605,F403 + - name: Test with pytest + run: | + python -m pytest --mpl --cov=radtraq/ diff --git a/.gitignore b/.gitignore index e0c484b3..f87afe19 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,6 @@ venv.bak/ # mypy .mypy_cache/ + +#vim +*.swp diff --git a/continuous_integration/environment_actions.yml b/continuous_integration/environment_actions.yml new file mode 100644 index 00000000..39ca6243 --- /dev/null +++ b/continuous_integration/environment_actions.yml @@ -0,0 +1,20 @@ +# Basic environment for ACT. +name: radtraq_env +channels: + - conda-forge + - defaults +dependencies: + - numpy + - scipy + - xarray + - matplotlib + - cython + - netcdf4 + - act-atmos + - pint + - flake8 + - pytest + - pytest-cov + - pytest-mpl + - coveralls + - pip diff --git a/radtraq/tests/baseline/test_cfad.png b/radtraq/tests/baseline/test_cfad.png deleted file mode 100644 index 07efe954..00000000 Binary files a/radtraq/tests/baseline/test_cfad.png and /dev/null differ diff --git a/radtraq/tests/baseline/test_cloud_mask.png b/radtraq/tests/baseline/test_cloud_mask.png index 19181e40..0b8fc13f 100644 Binary files a/radtraq/tests/baseline/test_cloud_mask.png and b/radtraq/tests/baseline/test_cloud_mask.png differ diff --git a/radtraq/tests/baseline/test_corner_reflector.png b/radtraq/tests/baseline/test_corner_reflector.png index 9791628d..b5c874bb 100644 Binary files a/radtraq/tests/baseline/test_corner_reflector.png and b/radtraq/tests/baseline/test_corner_reflector.png differ diff --git a/radtraq/tests/baseline/test_plotting.png b/radtraq/tests/baseline/test_plotting.png new file mode 100644 index 00000000..178d5dd9 Binary files /dev/null and b/radtraq/tests/baseline/test_plotting.png differ diff --git a/radtraq/tests/baseline/test_self_consistency.png b/radtraq/tests/baseline/test_self_consistency.png index 07127535..5f9e079d 100644 Binary files a/radtraq/tests/baseline/test_self_consistency.png and b/radtraq/tests/baseline/test_self_consistency.png differ