-
Notifications
You must be signed in to change notification settings - Fork 0
automations #11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
automations #11
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ac62a59
init pyproject.toml and src directory
ericbuckley 301d005
adding bootstrap.sh script
ericbuckley b1da46e
ignoring build artifacts
ericbuckley 0b9b9a4
adding pre-commit configuration for ruff check/format
ericbuckley 15ed961
adding check workflows
ericbuckley 637b08b
updating README with setup instructions
ericbuckley 5f54a39
updating bootstrap to configure pre-commit hooks
ericbuckley b5f849b
fix typo
ericbuckley 46dc3c7
fix typo
ericbuckley 1104388
adding tests dir
ericbuckley 7c9ff12
adding main file
ericbuckley 5c2ad2d
ignore .exrc
ericbuckley 1315571
add dummy test
ericbuckley 49efd21
simplifying unit tests
ericbuckley f3afed7
ignore python cache files
ericbuckley 82b0cff
import dibbs code in tests
ericbuckley 95c423b
adding badges
ericbuckley b12b610
adding slack notifications for github pull requests
ericbuckley b91305f
configure bootstrap.sh to work for Windows machines using gitbash
m-goggins 9cf7a1e
update readme for Windows
m-goggins File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,36 @@ | ||
| name: code vulnerabilities check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| codeql: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| packages: read | ||
| actions: read | ||
| contents: read | ||
| security-events: write | ||
|
|
||
| strategy: | ||
| matrix: | ||
| # Using a matrix in case we need to test Javascript code in the future | ||
| language: ['python'] | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Initialize CodeQL | ||
| uses: github/codeql-action/init@v3 | ||
| with: | ||
| languages: ${{ matrix.language }} | ||
|
|
||
| - name: Perform CodeQL Analysis | ||
| uses: github/codeql-action/analyze@v3 | ||
| with: | ||
| category: "/language:${{matrix.language}}" |
This file contains hidden or 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,30 @@ | ||
| name: lint check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| ruff: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install '.[dev]' | ||
|
|
||
| - name: Run lint checks | ||
| run: | | ||
| ruff check |
This file contains hidden or 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,30 @@ | ||
| name: type check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| ty: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install '.[dev]' | ||
|
|
||
| - name: Run type checks | ||
| run: | | ||
| ty check | ||
This file contains hidden or 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,42 @@ | ||
| name: unit tests check | ||
|
|
||
| on: | ||
| push: | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] | ||
|
|
||
| jobs: | ||
| pytest: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.13' | ||
| cache: 'pip' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| pip install '.[dev]' | ||
|
|
||
| - name: Run unit tests | ||
| shell: bash | ||
| run: | | ||
| pytest --cov=dibbs_text_to_code | ||
|
|
||
| - name: Generate coverage report | ||
| run: | | ||
| coverage xml -o coverage.xml | ||
|
|
||
| - name: Upload combined coverage to Codecov | ||
| uses: codecov/codecov-action@v4 | ||
| with: | ||
| token: ${{ secrets.CODECOV_TOKEN }} | ||
ericbuckley marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| files: coverage.xml | ||
| verbose: true | ||
This file contains hidden or 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,26 @@ | ||
| name: "post merged pull to slack" | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| branches: [main] | ||
| types: | ||
| - closed | ||
|
|
||
| jobs: | ||
| slack-pr-merged: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ github.event.pull_request.merged }} | ||
|
|
||
| steps: | ||
| - name: Send GitHub trigger payload to Slack | ||
| uses: slackapi/slack-github-action@v2.1.1 | ||
| with: | ||
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| text: ":github-merged: Pull request merged by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>", | ||
| blocks: | ||
| - type: "section", | ||
| text: | ||
| type: "mrkdwn" | ||
| text: ":github-merged: Pull request merged by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" |
This file contains hidden or 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,52 @@ | ||
| name: "post open pulls to slack" | ||
|
|
||
| on: | ||
| schedule: | ||
| # Run weekdays at 13:00 Eastern / 10:00 Pacific | ||
| - cron: "0 17 * * 1-5" | ||
|
|
||
| jobs: | ||
| list-open-prs: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| pull-requests: read | ||
| issues: read | ||
|
|
||
| steps: | ||
| - name: Check out the repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: List open pull requests | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| GITHUB_REPO: ${{ github.repository }} | ||
| run: > | ||
| PR_LIST=$(scripts/open_pulls.sh) | ||
|
|
||
| MSG=":code-review: Open Pull Requests\n\n" | ||
|
|
||
| while IFS= read -r line; do | ||
| MSG+="$line\n" | ||
| done < <(echo "$PR_LIST" | jq -r '.[] | " - <\(.html_url)|\(.title)> opened by \(.user) \(.time_since) days ago"') | ||
|
|
||
| echo "MSG=$MSG" >> $GITHUB_ENV | ||
| # Check if PR_LIST is empty and set a flag | ||
| if [ "$PR_LIST" == "[]" ]; then | ||
| echo "SHOULD_POST_TO_SLACK=false" >> $GITHUB_ENV | ||
| else | ||
| echo "SHOULD_POST_TO_SLACK=true" >> $GITHUB_ENV | ||
| fi | ||
|
|
||
| - name: Post to Slack | ||
| uses: slackapi/slack-github-action@v2.1.1 | ||
| if: ${{ env.SHOULD_POST_TO_SLACK == 'true' }} | ||
| with: | ||
| webhook: ${{ env.SLACK_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| text: "${{ env.MSG }}", | ||
| blocks: | ||
| - type: "section" | ||
| text: | ||
| type: "mrkdwn" | ||
| text: "${{ env.MSG }}" |
This file contains hidden or 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,29 @@ | ||
| name: "post ready pull to slack" | ||
|
|
||
| on: | ||
| pull_request_target: | ||
| branches: [main] | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - ready_for_review | ||
|
|
||
| jobs: | ||
| slack-ready-for-review: | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !github.event.pull_request.draft }} | ||
|
|
||
| steps: | ||
| - name: Send GitHub trigger payload to Slack | ||
| uses: slackapi/slack-github-action@v2.1.1 | ||
| with: | ||
| webhook: ${{ secrets.SLACK_WEBHOOK_URL }} | ||
| webhook-type: incoming-webhook | ||
| payload: | | ||
| text: ":pr-open: Pull request ready for review by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>", | ||
| blocks: | ||
| - type: "section" | ||
| text: | ||
| type: "mrkdwn" | ||
| text: ":pr-open: Pull request ready for review by ${{ github.event.pull_request.user.login }}\n\n<${{ github.event.pull_request.html_url }}|${{ github.event.pull_request.title }}>" | ||
|
|
This file contains hidden or 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,13 +1,28 @@ | ||
| # Build output | ||
| target/ | ||
| *.class | ||
| *_version.py | ||
| *.egg-info | ||
| build/ | ||
|
|
||
| # Log file | ||
| *.log | ||
|
|
||
| # Project environment files | ||
| .env | ||
|
|
||
| # Python-Virtual Environments | ||
| .venv | ||
| .python-version | ||
|
|
||
| # Python Cache | ||
| __pycache__/ | ||
| .pytest_cache/ | ||
|
|
||
| # Python-Coverage | ||
| .coverage | ||
| coverage.xml | ||
|
|
||
| # VS Code | ||
| /.vscode/settings.json | ||
| # Editor settings | ||
| /.vscode/settings.json | ||
| .exrc |
This file contains hidden or 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,7 @@ | ||
| repos: | ||
| - repo: https://github.com/astral-sh/ruff-pre-commit | ||
| rev: v0.12.3 # Ruff version. | ||
| hooks: | ||
| - id: ruff-check # Run the linter. | ||
| args: [ --fix ] | ||
| - id: ruff-format # Run the formatter. |
This file contains hidden or 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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.