diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 350745cb2..76d12e95e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -35,6 +35,13 @@ repos: tests/core/test_simpleeval.py )$ +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.23.0 + hooks: + - id: check-dependabot + - id: check-github-workflows + - id: check-readthedocs + - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.0.269 hooks: diff --git a/cookiecutter/tap-template/cookiecutter.json b/cookiecutter/tap-template/cookiecutter.json index def34dc64..8da7a099b 100644 --- a/cookiecutter/tap-template/cookiecutter.json +++ b/cookiecutter/tap-template/cookiecutter.json @@ -13,6 +13,6 @@ "JWT", "Custom or N/A" ], - "include_cicd_sample_template": ["GitHub", "None (Skip)"], + "include_ci_files": ["GitHub", "None (Skip)"], "license": ["Apache-2.0"] } diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_cicd_sample_template == 'GitHub' %}ci_workflow.yml{%endif%} b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} similarity index 58% rename from cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_cicd_sample_template == 'GitHub' %}ci_workflow.yml{%endif%} rename to cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} index daf4fa80c..0ea2f9ae7 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_cicd_sample_template == 'GitHub' %}ci_workflow.yml{%endif%} +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} @@ -6,25 +6,6 @@ name: Test {{cookiecutter.tap_id}} on: [push] jobs: - linting: - runs-on: ubuntu-latest - strategy: - matrix: - # Only lint using the primary version used for dev - python-version: ["3.9"] - steps: - - uses: actions/checkout@v3 - - name: Set up Python {{ '${{ matrix.python-version }}' }} - uses: actions/setup-python@v4 - with: - python-version: {{ '${{ matrix.python-version }}' }} - - name: Install pipx and Poetry - run: | - pip install pipx poetry - - name: Run lint command from tox.ini - run: | - pipx run tox -e lint - pytest: runs-on: ubuntu-latest env: diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} new file mode 100644 index 000000000..933e6b1c2 --- /dev/null +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} @@ -0,0 +1,26 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: pip + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps): " + prefix-development: "chore(deps-dev): " + - package-ecosystem: pip + directory: "/.github/workflows" + schedule: + interval: daily + commit-message: + prefix: "ci: " + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci: " diff --git a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml index 6dad569ee..0fa8915aa 100644 --- a/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml +++ b/cookiecutter/tap-template/{{cookiecutter.tap_id}}/.pre-commit-config.yaml @@ -13,6 +13,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.23.0 + hooks: + - id: check-dependabot + - id: check-github-workflows + - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.0.269 hooks: diff --git a/cookiecutter/target-template/cookiecutter.json b/cookiecutter/target-template/cookiecutter.json index b14c78c42..4816b54aa 100644 --- a/cookiecutter/target-template/cookiecutter.json +++ b/cookiecutter/target-template/cookiecutter.json @@ -5,5 +5,6 @@ "library_name": "{{ cookiecutter.target_id.replace('-', '_') }}", "variant": "None (Skip)", "serialization_method": ["Per record", "Per batch", "SQL"], + "include_ci_files": ["GitHub", "None (Skip)"], "license": ["Apache-2.0"] } diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} new file mode 100644 index 000000000..0ea2f9ae7 --- /dev/null +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/workflows/{% if cookiecutter.include_ci_files == 'GitHub' %}test.yml{%endif%} @@ -0,0 +1,30 @@ +### A CI workflow template that runs linting and python testing +### TODO: Modify as needed or as desired. + +name: Test {{cookiecutter.tap_id}} + +on: [push] + +jobs: + pytest: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: {{ '${{secrets.GITHUB_TOKEN}}' }} + strategy: + matrix: + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + steps: + - uses: actions/checkout@v3 + - name: Set up Python {{ '${{ matrix.python-version }}' }} + uses: actions/setup-python@v4 + with: + python-version: {{ '${{ matrix.python-version }}' }} + - name: Install Poetry + run: | + pip install poetry + - name: Install dependencies + run: | + poetry install + - name: Test with pytest + run: | + poetry run pytest diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} new file mode 100644 index 000000000..933e6b1c2 --- /dev/null +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.github/{% if cookiecutter.include_ci_files == 'GitHub' %}dependabot.yml{%endif%} @@ -0,0 +1,26 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: pip + directory: "/" + schedule: + interval: "daily" + commit-message: + prefix: "chore(deps): " + prefix-development: "chore(deps-dev): " + - package-ecosystem: pip + directory: "/.github/workflows" + schedule: + interval: daily + commit-message: + prefix: "ci: " + - package-ecosystem: github-actions + directory: "/" + schedule: + interval: "weekly" + commit-message: + prefix: "ci: " diff --git a/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml b/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml index 34122e41d..5e82dd4ff 100644 --- a/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml +++ b/cookiecutter/target-template/{{cookiecutter.target_id}}/.pre-commit-config.yaml @@ -13,6 +13,12 @@ repos: - id: end-of-file-fixer - id: trailing-whitespace +- repo: https://github.com/python-jsonschema/check-jsonschema + rev: 0.23.0 + hooks: + - id: check-dependabot + - id: check-github-workflows + - repo: https://github.com/charliermarsh/ruff-pre-commit rev: v0.0.269 hooks: diff --git a/e2e-tests/cookiecutters/tap-graphql-jwt.json b/e2e-tests/cookiecutters/tap-graphql-jwt.json index f06c4158c..0c322e06f 100644 --- a/e2e-tests/cookiecutters/tap-graphql-jwt.json +++ b/e2e-tests/cookiecutters/tap-graphql-jwt.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "GraphQL", "auth_method": "JWT", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-other-custom.json b/e2e-tests/cookiecutters/tap-other-custom.json index fd4982d6e..ac3816774 100644 --- a/e2e-tests/cookiecutters/tap-other-custom.json +++ b/e2e-tests/cookiecutters/tap-other-custom.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "Other", "auth_method": "Custom or N/A", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-api_key-github.json b/e2e-tests/cookiecutters/tap-rest-api_key-github.json index 75a09c3d0..e65981940 100644 --- a/e2e-tests/cookiecutters/tap-rest-api_key-github.json +++ b/e2e-tests/cookiecutters/tap-rest-api_key-github.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "API Key", - "include_cicd_sample_template": "GitHub", + "include_ci_files": "GitHub", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-basic_auth.json b/e2e-tests/cookiecutters/tap-rest-basic_auth.json index a2411fd67..33eb7b625 100644 --- a/e2e-tests/cookiecutters/tap-rest-basic_auth.json +++ b/e2e-tests/cookiecutters/tap-rest-basic_auth.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "Basic Auth", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-bearer_token.json b/e2e-tests/cookiecutters/tap-rest-bearer_token.json index 39e308225..f506061dd 100644 --- a/e2e-tests/cookiecutters/tap-rest-bearer_token.json +++ b/e2e-tests/cookiecutters/tap-rest-bearer_token.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "Bearer Token", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-custom.json b/e2e-tests/cookiecutters/tap-rest-custom.json index 8de0ff1b1..5d68d60bf 100644 --- a/e2e-tests/cookiecutters/tap-rest-custom.json +++ b/e2e-tests/cookiecutters/tap-rest-custom.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "Custom or N/A", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-jwt.json b/e2e-tests/cookiecutters/tap-rest-jwt.json index 0e5624e7a..80837f244 100644 --- a/e2e-tests/cookiecutters/tap-rest-jwt.json +++ b/e2e-tests/cookiecutters/tap-rest-jwt.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "JWT", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-rest-oauth2.json b/e2e-tests/cookiecutters/tap-rest-oauth2.json index 35a5064a2..27c7c39df 100644 --- a/e2e-tests/cookiecutters/tap-rest-oauth2.json +++ b/e2e-tests/cookiecutters/tap-rest-oauth2.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "REST", "auth_method": "OAuth2", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/tap-sql-custom.json b/e2e-tests/cookiecutters/tap-sql-custom.json index d42c5d179..96fa379d7 100644 --- a/e2e-tests/cookiecutters/tap-sql-custom.json +++ b/e2e-tests/cookiecutters/tap-sql-custom.json @@ -7,7 +7,7 @@ "variant": "None (Skip)", "stream_type": "SQL", "auth_method": "Custom or N/A", - "include_cicd_sample_template": "None (Skip)", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "../tap-template/", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/target-per_record.json b/e2e-tests/cookiecutters/target-per_record.json index bedc62c2c..9e0047af1 100644 --- a/e2e-tests/cookiecutters/target-per_record.json +++ b/e2e-tests/cookiecutters/target-per_record.json @@ -6,6 +6,7 @@ "library_name": "target_per_record", "variant": "None (Skip)", "serialization_method": "Per record", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "./sdk/cookiecutter/target-template", "_output_dir": "." diff --git a/e2e-tests/cookiecutters/target-sql.json b/e2e-tests/cookiecutters/target-sql.json index 3aeba547a..5802e5ede 100644 --- a/e2e-tests/cookiecutters/target-sql.json +++ b/e2e-tests/cookiecutters/target-sql.json @@ -6,6 +6,7 @@ "library_name": "target_sql", "variant": "None (Skip)", "serialization_method": "SQL", + "include_ci_files": "None (Skip)", "license": "Apache-2.0", "_template": "./sdk/cookiecutter/target-template", "_output_dir": "."