-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Build empty cookiecutters and run lint task during CI (#1410)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Edgar R. M <[email protected]>
- Loading branch information
1 parent
f953a0d
commit faf95bd
Showing
19 changed files
with
419 additions
and
142 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,72 @@ | ||
name: E2E Cookiecutters | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
paths: ["cookiecutter/**", "e2e-tests/cookiecutters/**"] | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
env: | ||
FORCE_COLOR: "1" | ||
|
||
jobs: | ||
lint: | ||
name: Lint ${{ matrix.cookiecutter }}, Replay ${{ matrix.replay }} on ${{ matrix.python-version }} ${{ matrix.python-version }} / ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
include: | ||
- { cookiecutter: "tap-template", replay: "tap-rest-api_key-github.json", python-version: "3.9", os: "ubuntu-latest" } | ||
- { cookiecutter: "tap-template", replay: "tap-rest-jwt-github.json", python-version: "3.9", os: "ubuntu-latest" } | ||
- { cookiecutter: "target-template", replay: "target-per_record.json", python-version: "3.9", os: "ubuntu-latest" } | ||
|
||
steps: | ||
- name: Check out the repository | ||
uses: actions/[email protected] | ||
|
||
- name: Setup Python ${{ matrix.python-version }} | ||
uses: actions/[email protected] | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
architecture: x64 | ||
|
||
- name: Upgrade pip | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
run: | | ||
pip install pip | ||
pip --version | ||
- name: Install Poetry, Tox & Cookiecutter | ||
env: | ||
PIP_CONSTRAINT: .github/workflows/constraints.txt | ||
run: | | ||
pipx install poetry | ||
pipx install cookiecutter | ||
pipx install tox | ||
- name: Build cookiecutter project | ||
env: | ||
CC_TEMPLATE: cookiecutter/${{ matrix.cookiecutter }} | ||
REPLAY_FILE: e2e-tests/cookiecutters/${{ matrix.replay }} | ||
run: | | ||
bash e2e-tests/cookiecutters/test_cookiecutter.sh $CC_TEMPLATE $REPLAY_FILE 0 | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: ${{ matrix.replay }} | ||
path: | | ||
${{ env.CC_TEST_OUTPUT }}/ | ||
!${{ env.CC_TEST_OUTPUT }}/.mypy_cache/ | ||
- name: Run lint | ||
env: | ||
REPLAY_FILE: e2e-tests/cookiecutters/${{ matrix.replay }} | ||
run: | | ||
cd $CC_TEST_OUTPUT | ||
poetry run tox -e lint |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Tap for {{ cookiecutter.source_name }}.""" |
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
6 changes: 4 additions & 2 deletions
6
...cookiecutter.library_name}}/{%if 'Other' == cookiecutter.stream_type %}client.py{%endif%}
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.
faf95bd
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
The recent changes to the cookiecutter template have broken something. I'm running into this error for REST APIs with Custom auth:
ERROR tests/test_core.py - NameError: name 'RESTStream' is not defined
Could you have a please.
Asante,
Aka