-
Notifications
You must be signed in to change notification settings - Fork 14
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 #82 from Riminder/v2
V2
- Loading branch information
Showing
273 changed files
with
12,893 additions
and
57,588 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
[flake8] | ||
max-line-length = 88 | ||
exclude = .pytest_cache,__pycache__ | ||
ignore = E731, W503, E203 | ||
per-file-ignores = | ||
src/hrflow_connectors/core/templates.py: E501 |
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 @@ | ||
tests/data/** filter=lfs diff=lfs merge=lfs -text |
Validating CODEOWNERS rules …
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 @@ | ||
/.github/ @Riminder/admin |
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,150 @@ | ||
name: HrFlow.ai Connectors | ||
|
||
on: | ||
pull_request_target: | ||
types: [labeled, opened, synchronize, reopened] | ||
branches: | ||
- "master" | ||
|
||
env: | ||
PYTHON_VERSION: 3.10.5 | ||
POETRY_VERSION: 1.1.12 | ||
|
||
jobs: | ||
core-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check permissions for job | ||
if: ${{ !(contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, 'run tests for fork'))}} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
core.setFailed("Not enough permissions to run Core Tests") | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
lfs: true | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Load cached Poetry installation | ||
id: cached-poetry-install | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ env.POETRY_VERSION }} | ||
|
||
- name: Install poetry | ||
if: steps.cached-poetry-install.outputs.cache-hit != 'true' | ||
run: curl -sSL https://install.python-poetry.org | POETRY_VERSION=$POETRY_VERSION python3 - | ||
|
||
- name: Add poetry to PATH | ||
run: export PATH="$HOME/.local/bin:$PATH" | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Install python dependencies | ||
if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' | ||
run: POETRY_INSTALLER_PARALLEL=1 POETRY_VIRTUALENVS_IN_PROJECT=1 poetry install -E s3 | ||
|
||
- name: Run commit hooks | ||
run: poetry run pre-commit run --hook-stage commit --all-files | ||
|
||
- name: Check manifest is up to date | ||
run: poetry run pre-commit run --hook-stage push --all-files hrflow_connectors_manifest | ||
|
||
- name: Check documentation is up to date | ||
run: poetry run pre-commit run --hook-stage push --all-files hrflow_connectors_docs | ||
|
||
- name: Run Core tests | ||
run: | | ||
poetry run pytest | ||
env: | ||
HRFLOW_CONNECTORS_STORE_ENABLED: "1" | ||
HRFLOW_CONNECTORS_LOCALJSON_DIR: "/tmp/" | ||
S3_STORE_TEST_BUCKET: ${{ secrets.S3_STORE_TEST_BUCKET }} | ||
S3_STORE_TEST_AWS_REGION: ${{ secrets.S3_STORE_TEST_AWS_REGION }} | ||
S3_STORE_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_AWS_SECRET_ACCESS_KEY }} | ||
S3_STORE_TEST_READ_ONLY_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_READ_ONLY_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_READ_ONLY_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_READ_ONLY_AWS_SECRET_ACCESS_KEY }} | ||
S3_STORE_TEST_WRITE_ONLY_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_WRITE_ONLY_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_WRITE_ONLY_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_WRITE_ONLY_AWS_SECRET_ACCESS_KEY }} | ||
|
||
connectors-integration-tests: | ||
runs-on: ubuntu-latest | ||
needs: core-tests | ||
steps: | ||
- name: Check permissions for job | ||
if: ${{ !(contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.pull_request.author_association) || contains(github.event.pull_request.labels.*.name, 'run tests for fork'))}} | ||
uses: actions/github-script@v3 | ||
with: | ||
script: | | ||
core.setFailed("Not enough permissions to run Integration Tests") | ||
- uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
lfs: true | ||
|
||
- uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ env.PYTHON_VERSION }} | ||
|
||
- name: Load cached Poetry installation | ||
id: cached-poetry-install | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.local | ||
key: poetry-${{ env.POETRY_VERSION }} | ||
|
||
- name: Load cached venv | ||
id: cached-poetry-dependencies | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ runner.os }}-${{ env.PYTHON_VERSION }}-${{ hashFiles('**/poetry.lock') }} | ||
|
||
- name: Add poetry to PATH | ||
run: export PATH="$HOME/.local/bin:$PATH" | ||
|
||
- name: Run Connector tests | ||
run: | | ||
echo $ALL_SECRETS > src/hrflow_connectors/connectors/secrets.json | ||
poetry run pytest --no-cov --ignore tests/core --allconnectors | ||
env: | ||
ALL_SECRETS: ${{ toJson(secrets) }} | ||
HRFLOW_CONNECTORS_STORE_ENABLED: "1" | ||
HRFLOW_CONNECTORS_LOCALJSON_DIR: "/tmp/" | ||
S3_STORE_TEST_BUCKET: ${{ secrets.S3_STORE_TEST_BUCKET }} | ||
S3_STORE_TEST_AWS_REGION: ${{ secrets.S3_STORE_TEST_AWS_REGION }} | ||
S3_STORE_TEST_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_AWS_SECRET_ACCESS_KEY }} | ||
S3_STORE_TEST_READ_ONLY_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_READ_ONLY_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_READ_ONLY_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_READ_ONLY_AWS_SECRET_ACCESS_KEY }} | ||
S3_STORE_TEST_WRITE_ONLY_AWS_ACCESS_KEY_ID: ${{ secrets.S3_STORE_TEST_WRITE_ONLY_AWS_ACCESS_KEY_ID }} | ||
S3_STORE_TEST_WRITE_ONLY_AWS_SECRET_ACCESS_KEY: ${{ secrets.S3_STORE_TEST_WRITE_ONLY_AWS_SECRET_ACCESS_KEY }} | ||
|
||
reset-labels: | ||
runs-on: ubuntu-latest | ||
if: ${{ always() }} | ||
needs: [core-tests, connectors-integration-tests] | ||
permissions: | ||
issues: write | ||
pull-requests: write | ||
steps: | ||
- name: Remove run tests for fork label | ||
run: | | ||
curl \ | ||
-X DELETE \ | ||
-H 'Accept: application/vnd.github.v3+json' \ | ||
-H 'Authorization: token ${{ github.token }}' \ | ||
'https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.number }}/labels/run%20tests%20for%20fork' |
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,66 +1,6 @@ | ||
# Temporary and binary files | ||
*~ | ||
*.py[cod] | ||
*.so | ||
*.env | ||
*.cfg | ||
!.isort.cfg | ||
!setup.cfg | ||
*.orig | ||
*.log | ||
*.pot | ||
__pycache__/* | ||
.cache/* | ||
.*.swp | ||
*/.ipynb_checkpoints/* | ||
.ipynb_checkpoints | ||
.DS_Store | ||
*chromedriver* | ||
|
||
# Project files | ||
.ropeproject | ||
.project | ||
.pydevproject | ||
.settings | ||
.idea | ||
.vscode | ||
tags | ||
|
||
# Package files | ||
*.egg | ||
*.eggs/ | ||
.installed.cfg | ||
*.egg-info | ||
|
||
# Unittest and coverage | ||
htmlcov/* | ||
.coverage | ||
.coverage.* | ||
.tox | ||
junit*.xml | ||
coverage.xml | ||
.python-version | ||
__pycache__/ | ||
.pytest_cache/ | ||
test.ipynb | ||
|
||
# Build and docs folder/files | ||
build/* | ||
dist/* | ||
sdist/* | ||
docs/api/* | ||
docs/_rst/* | ||
docs/_build/* | ||
cover/* | ||
MANIFEST | ||
|
||
# Per-project virtualenvs | ||
.venv*/ | ||
.conda*/ | ||
.env | ||
|
||
# Credentials | ||
credentials | ||
.credentials | ||
credentials.json | ||
credential | ||
.credential | ||
credential.json | ||
.vscode/ | ||
.coverage | ||
secrets.json |
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,32 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v3.2.0 | ||
hooks: | ||
- id: check-added-large-files | ||
- repo: local | ||
hooks: | ||
- id: flake8 | ||
name: flake8 | ||
entry: poetry run flake8 | ||
language: system | ||
types: [python] | ||
args: [--config=.flake8] | ||
stages: [commit] | ||
|
||
- id: hrflow_connectors_manifest | ||
name: hrflow_connectors_manifest | ||
entry: poetry run python -c 'from hrflow_connectors import __CONNECTORS__, hrflow_connectors_manifest as m; m(connectors=__CONNECTORS__)' | ||
language: system | ||
stages: [push] | ||
always_run: true | ||
pass_filenames: false | ||
|
||
- id: hrflow_connectors_docs | ||
name: hrflow_connectors_docs | ||
entry: poetry run python -c 'from hrflow_connectors import __CONNECTORS__, generate_docs as m; m(connectors=__CONNECTORS__)' | ||
language: system | ||
stages: [push] | ||
always_run: true | ||
pass_filenames: false |
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.