-
Notifications
You must be signed in to change notification settings - Fork 0
Introduce GH Actions workflows and test them within a PR #1
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
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
e068b2b
fix
yancostrishevsky b67c2f4
directory fix
yancostrishevsky 6c35f5d
fix
yancostrishevsky aea2c87
mount fix
yancostrishevsky f9c722a
fix
yancostrishevsky 0969cd7
fix
yancostrishevsky e1b4858
fix
yancostrishevsky 38b5e54
fix
yancostrishevsky 644b106
fix
yancostrishevsky 6dfc880
fix
yancostrishevsky 6e8fbb6
fix
yancostrishevsky 21a5e94
fix
yancostrishevsky 9ba6a7e
nio
yancostrishevsky 3a8bdeb
Merge branch 'develop' into gh-actions
WiktorProsowicz 3ab411e
Rename context-retriever .devcontainer config for name consistency
WiktorProsowicz 162a0eb
Enable firing workflows on changes to devcontainer setup
WiktorProsowicz 9da7e01
Add environment setup before running precommit
WiktorProsowicz e5e21ef
Move pre-commit action to a separate file
WiktorProsowicz ca63353
Modify service-checks config
WiktorProsowicz bf706b6
Fix problem with not checked-out repo for pre-commit action
WiktorProsowicz 5550cae
Merge branch 'develop' into gh-actions
WiktorProsowicz 3bb66f7
Add bash as the shell for creating ssh auth sock
WiktorProsowicz b16ea47
Up
WiktorProsowicz 63b8656
Up
WiktorProsowicz 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
File renamed without changes.
File renamed without changes.
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: Run Pre-commit for Service | ||
| description: Set up a Dev-Container for a specific service and run pre-commit checks within that environment. | ||
|
|
||
| inputs: | ||
| devcontainer-cfg-path: | ||
| description: Directory containing .devcontainer configuration for the service. | ||
| required: true | ||
|
|
||
| service-workdir: | ||
| description: Working directory inside the Dev-Container where the service code resides. | ||
| required: true | ||
|
|
||
| runs: | ||
| using: composite | ||
|
|
||
| steps: | ||
| - name: Verify Docker engine | ||
| run: docker version | ||
| shell: bash | ||
|
|
||
| - name: Ensure SSH agent mount path exists | ||
| run: | | ||
| if [ ! -e "${SSH_AUTH_SOCK}" ]; then | ||
| touch "${SSH_AUTH_SOCK}" | ||
| fi | ||
| shell: bash | ||
|
|
||
| - name: Run pre-commit in devcontainer | ||
| uses: devcontainers/ci@v0.3 | ||
| with: | ||
| configFile: ${{ inputs.devcontainer-cfg-path }}/devcontainer.json | ||
| runCmd: | | ||
| cd ${{ inputs.service-workdir }} && \ | ||
| just setup-environment && \ | ||
| just run-precommit |
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,78 +1,113 @@ | ||
| name: Service checks | ||
| name: Service Checks | ||
| description: Run pre-commit static analysis on services having their own Dev-Container setup. | ||
|
|
||
| on: | ||
| pull_request: | ||
| paths: | ||
| - "services/**" | ||
| - ".pre-commit-config.yaml" | ||
| - "pyproject.toml" | ||
| - ".github/workflows/service-checks.yml" | ||
| push: | ||
| - .github/workflows/service-checks.yml | ||
WiktorProsowicz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - .pre-commit-config.yaml | ||
| - pyproject.toml | ||
| - services/context-retriever/** | ||
| - services/web-app/** | ||
| - services/llm-proxy/** | ||
| - .devcontainer/** | ||
| branches: [main, develop] | ||
| paths: | ||
| - "services/**" | ||
| - ".pre-commit-config.yaml" | ||
| - "pyproject.toml" | ||
| - ".github/workflows/service-checks.yml" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| # Dummy socket to simulate mounting SSH agent into Dev-Container | ||
| SSH_AUTH_SOCK: /tmp/ssh-agent | ||
|
|
||
| jobs: | ||
| changes: | ||
| runs-on: ubuntu-latest | ||
| name: Detect changed services | ||
| runs-on: ubuntu-24.04 | ||
WiktorProsowicz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| outputs: | ||
| llm_proxy: ${{ steps.filter.outputs.llm_proxy }} | ||
| web_app: ${{ steps.filter.outputs.web_app }} | ||
| context-retriever: ${{ steps.filter.outputs.context-retriever }} | ||
| web-app: ${{ steps.filter.outputs.web-app }} | ||
| llm-proxy: ${{ steps.filter.outputs.llm-proxy }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: dorny/paths-filter@v3 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Determine impacted services | ||
| id: filter | ||
| uses: dorny/paths-filter@v3 | ||
| with: | ||
| filters: | | ||
| llm_proxy: | ||
| - 'services/llm-proxy/**' | ||
| - '.pre-commit-config.yaml' | ||
| - 'pyproject.toml' | ||
| web_app: | ||
| - 'services/web-app/**' | ||
| - '.pre-commit-config.yaml' | ||
| - 'pyproject.toml' | ||
| context-retriever: | ||
WiktorProsowicz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - services/context-retriever/** | ||
| - .pre-commit-config.yaml | ||
| - pyproject.toml | ||
| - .github/workflows/service-checks.yml | ||
| - .devcontainer/context-retriever/** | ||
| - .devcontainer/scripts/** | ||
| web-app: | ||
| - services/web-app/** | ||
| - .pre-commit-config.yaml | ||
| - pyproject.toml | ||
| - .github/workflows/service-checks.yml | ||
| - .devcontainer/web-app/** | ||
| - .devcontainer/scripts/** | ||
| llm-proxy: | ||
| - services/llm-proxy/** | ||
| - .pre-commit-config.yaml | ||
| - pyproject.toml | ||
| - .github/workflows/service-checks.yml | ||
| - .devcontainer/llm-proxy/** | ||
| - .devcontainer/scripts/** | ||
|
|
||
| precommit-llm-proxy: | ||
| runs-on: ubuntu-latest | ||
| precommit-context-retriever: | ||
| name: Pre-commit (context-retriever) | ||
| runs-on: ubuntu-24.04 | ||
| needs: changes | ||
| if: needs.changes.outputs.llm_proxy == 'true' | ||
| if: needs.changes.outputs.context-retriever == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v5 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run pre-commit for context-retriever | ||
| uses: ./.github/actions/run-precommit-for-service | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| working-directory: services/llm-proxy | ||
| run: | | ||
| uv venv | ||
| uv pip install -e ".[dev]" | ||
| - name: Run pre-commit | ||
| working-directory: services/llm-proxy | ||
| run: | | ||
| uv run pre-commit run -c ../../.pre-commit-config.yaml --files $(git -C ../.. ls-files services/llm-proxy) | ||
| devcontainer-cfg-path: .devcontainer/context-retriever | ||
| service-workdir: /home/appuser/workspace/services/context-retriever | ||
|
|
||
|
|
||
| precommit-web-app: | ||
| runs-on: ubuntu-latest | ||
| name: Pre-commit (web-app) | ||
| runs-on: ubuntu-24.04 | ||
| needs: changes | ||
| if: needs.changes.outputs.web-app == 'true' | ||
WiktorProsowicz marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run pre-commit for web-app | ||
| uses: ./.github/actions/run-precommit-for-service | ||
| with: | ||
| devcontainer-cfg-path: .devcontainer/web-app | ||
| service-workdir: /home/appuser/workspace/services/web-app | ||
|
|
||
| precommit-llm-proxy: | ||
| name: Pre-commit (llm-proxy) | ||
| runs-on: ubuntu-24.04 | ||
| needs: changes | ||
| if: needs.changes.outputs.web_app == 'true' | ||
| if: needs.changes.outputs.llm-proxy == 'true' | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: astral-sh/setup-uv@v5 | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Run pre-commit for llm-proxy | ||
| uses: ./.github/actions/run-precommit-for-service | ||
| with: | ||
| python-version: "3.12" | ||
| - name: Install dependencies | ||
| working-directory: services/web-app | ||
| run: | | ||
| uv venv | ||
| uv pip install -e ".[dev]" | ||
| - name: Run pre-commit | ||
| working-directory: services/web-app | ||
| run: | | ||
| uv run pre-commit run -c ../../.pre-commit-config.yaml --files $(git -C ../.. ls-files services/web-app) | ||
| devcontainer-cfg-path: .devcontainer/llm-proxy | ||
| service-workdir: /home/appuser/workspace/services/llm-proxy | ||
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
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
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.