diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 00000000..ca9cc5ad --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,73 @@ +# Compare: https://github.com/pangeo-forge/pangeo-forge-recipes/blob/master/.github/workflows/main.yaml + +name: Tests + +on: + push: + branches: "*" + paths-ignore: + - 'docs/**' + pull_request: + branches: master + paths-ignore: + - 'docs/**' + +env: + PYTEST_ADDOPTS: "--color=yes" + +jobs: + test: + name: ${{ matrix.python-version }}-build + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: [3.8, 3.9] + steps: + - uses: actions/checkout@v2 + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python-version }} + architecture: x64 + # - name: Cache conda + # uses: actions/cache@v1 + # env: + # Increase this value to reset cache if ci/py${{ matrix.python-version }}.yml has not changed + # CACHE_NUMBER: 0 + # with: + # path: ~/conda_pkgs_dir + # key: ${{ runner.os }}-conda-${{ env.CACHE_NUMBER }}-${{ hashFiles('ci/py${{ matrix.python-version }}.yml') }} + - name: setup miniconda + uses: conda-incubator/setup-miniconda@v2 + with: + # activate-environment: pangeo-forge-recipes + # environment-file: ci/py${{ matrix.python-version }}.yml + python-version: ${{ matrix.python-version }} + auto-activate-base: false + # use-only-tar-bz2: true + - name: install pangeo-forge-orchestrator plus deps + shell: bash -l {0} + run: | + poetry install + - name: print conda env + shell: bash -l {0} + run: | + conda info + conda list + - name: Run Tests + shell: bash -l {0} + run: | + pytest tests -v + # --redirect-dask-worker-logs-to-stdout=DEBUG \ + # --cov=pangeo_forge_recipes --cov-config .coveragerc \ + # --cov-report term-missing \ + # --cov-report xml \ + # --durations=10 --durations-min=1.0 + #- name: Codecov + # uses: codecov/codecov-action@v2.0.2 + # with: + # file: ./coverage.xml + # env_vars: OS,PYTHON + # name: codecov-umbrella + # fail_ci_if_error: false diff --git a/.github/workflows/pre-commit.yaml b/.github/workflows/pre-commit.yaml new file mode 100644 index 00000000..b52d4afe --- /dev/null +++ b/.github/workflows/pre-commit.yaml @@ -0,0 +1,14 @@ +name: pre-commit + +on: + pull_request: + push: + branches: [main] + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v2 + - uses: pre-commit/action@v2.0.0