-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from umr-lops/add_extra_outdir_check
donwload checking directories enlarged.
- Loading branch information
Showing
27 changed files
with
660 additions
and
383 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
changelog: | ||
exclude: | ||
authors: | ||
- dependabot | ||
- pre-commit-ci |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
branches: [main] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
detect-skip-ci-trigger: | ||
name: "Detect CI Trigger: [skip-ci]" | ||
if: | | ||
github.repository == 'umr-lops/cdsodatacli' | ||
&& github.event_name == 'push' | ||
|| github.event_name == 'pull_request' | ||
runs-on: ubuntu-latest | ||
outputs: | ||
triggered: ${{ steps.detect-trigger.outputs.trigger-found }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: xarray-contrib/ci-trigger@v1 | ||
id: detect-trigger | ||
with: | ||
keyword: "[skip-ci]" | ||
|
||
ci: | ||
name: ${{ matrix.os }} py${{ matrix.python-version }} | ||
runs-on: ${{ matrix.os }} | ||
needs: detect-skip-ci-trigger | ||
|
||
if: needs.detect-skip-ci-trigger.outputs.triggered == 'false' | ||
|
||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: ["3.10", "3.11", "3.12"] | ||
os: ["ubuntu-latest", "macos-latest", "windows-latest"] | ||
|
||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
# need to fetch all tags to get a correct version | ||
fetch-depth: 0 # fetch all branches and tags | ||
|
||
- name: Setup environment variables | ||
run: | | ||
echo "TODAY=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | ||
echo "CONDA_ENV_FILE=ci/requirements/environment.yaml" >> $GITHUB_ENV | ||
- name: Setup micromamba | ||
uses: mamba-org/setup-micromamba@v2 | ||
with: | ||
environment-file: ${{ env.CONDA_ENV_FILE }} | ||
environment-name: cdsodatacli-tests | ||
cache-environment: true | ||
cache-environment-key: "${{runner.os}}-${{runner.arch}}-py${{matrix.python-version}}-${{env.TODAY}}-${{hashFiles(env.CONDA_ENV_FILE)}}" | ||
create-args: >- | ||
python=${{matrix.python-version}} | ||
conda | ||
- name: Install cdsodatacli | ||
run: | | ||
python -m pip install --no-deps -e . | ||
- name: Import cdsodatacli | ||
run: | | ||
python -c "import cdsodatacli" | ||
- name: Create secrets.yml from GitHub Secret | ||
run: | | ||
echo "${{ secrets.SECRET_FOR_TEST_DOWNLOAD_CDSE }}" > secrets.yml | ||
shell: bash | ||
|
||
- name: Export secrets as environment variables | ||
run: | | ||
export DEFAULT_LOGIN_CDSE=$(grep 'DEFAULT_LOGIN_CDSE' secrets.yml | cut -d':' -f2 | tr -d ' ') | ||
export DEFAULT_PASSWD_CDSE=$(grep 'DEFAULT_PASSWD_CDSE' secrets.yml | cut -d':' -f2 | tr -d ' ') | ||
echo "DEFAULT_LOGIN_CDSE=${DEFAULT_LOGIN_CDSE}" >> $GITHUB_ENV | ||
echo "DEFAULT_PASSWD_CDSE=${DEFAULT_PASSWD_CDSE}" >> $GITHUB_ENV | ||
shell: bash | ||
- name: Run tests | ||
env: | ||
DEFAULT_LOGIN_CDSE: ${{ env.DEFAULT_LOGIN_CDSE }} | ||
DEFAULT_PASSWD_CDSE: ${{ env.DEFAULT_PASSWD_CDSE }} | ||
run: | | ||
python -m pytest --cov=cdsodatacli |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,41 @@ | ||
default_language_version: | ||
python: python3.9 | ||
|
||
default_stages: [commit, push] | ||
ci: | ||
autoupdate_schedule: monthly | ||
|
||
# https://pre-commit.com/ | ||
repos: | ||
- repo: /~https://github.com/pre-commit/pre-commit-hooks | ||
rev: v2.5.0 | ||
rev: v5.0.0 | ||
hooks: | ||
- id: check-yaml | ||
- id: trailing-whitespace | ||
- id: end-of-file-fixer | ||
exclude: LICENSE | ||
|
||
- repo: local | ||
- id: check-docstring-first | ||
- repo: /~https://github.com/psf/black | ||
rev: 24.10.0 | ||
hooks: | ||
- id: pyupgrade | ||
name: pyupgrade | ||
entry: poetry run pyupgrade --py39-plus | ||
types: [python] | ||
language: system | ||
|
||
- repo: local | ||
- id: black | ||
- repo: /~https://github.com/keewis/blackdoc | ||
rev: v0.3.9 | ||
hooks: | ||
- id: isort | ||
name: isort | ||
entry: poetry run isort --settings-path pyproject.toml | ||
types: [python] | ||
language: system | ||
|
||
- repo: local | ||
- id: blackdoc | ||
additional_dependencies: ["black==24.10.0"] | ||
- id: blackdoc-autoupdate-black | ||
- repo: /~https://github.com/astral-sh/ruff-pre-commit | ||
rev: v0.7.1 | ||
hooks: | ||
- id: black | ||
name: black | ||
entry: poetry run black --config pyproject.toml | ||
types: [python] | ||
language: system | ||
- id: ruff | ||
args: [--fix] | ||
- repo: /~https://github.com/kynan/nbstripout | ||
rev: 0.7.1 | ||
hooks: | ||
- id: nbstripout | ||
args: [--extra-keys=metadata.kernelspec metadata.language_info.version] | ||
- repo: /~https://github.com/rbubley/mirrors-prettier | ||
rev: v3.3.3 | ||
hooks: | ||
- id: prettier | ||
- repo: /~https://github.com/ComPWA/taplo-pre-commit | ||
rev: v0.9.3 | ||
hooks: | ||
- id: taplo-format | ||
- id: taplo-lint | ||
args: [--no-schema] |
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
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
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
Oops, something went wrong.