-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
59d4bd9
commit dabc0b3
Showing
48 changed files
with
3,075 additions
and
139 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,69 @@ | ||
{ | ||
"name": "vespadb", | ||
"dockerComposeFile": "../docker-compose.yml", | ||
"service": "devcontainer", | ||
"runServices": [ | ||
"devcontainer" | ||
], | ||
"shutdownAction": "stopCompose", | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/workspaces/vespadb/,type=bind,consistency=delegated", | ||
"workspaceFolder": "/workspaces/vespadb/", | ||
"remoteUser": "root", | ||
"overrideCommand": true, | ||
"initializeCommand": "touch ${localWorkspaceFolder}/.env", | ||
"mounts": [ | ||
"type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock,consistency=consistent" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"eamodio.gitlens", | ||
"github.copilot", | ||
"ms-azuretools.vscode-docker", | ||
"ms-python.mypy-type-checker", | ||
"ms-python.python", | ||
"henriiik.vscode-ruff", | ||
"charliermarsh.ruff", | ||
"ryanluker.vscode-coverage-gutters", | ||
"tamasfe.even-better-toml", | ||
"visualstudioexptteam.vscodeintellicode", | ||
"GitHub.copilot-chat", | ||
"GitHub.copilot" | ||
], | ||
"settings": { | ||
"coverage-gutters.coverageFileNames": [ | ||
"reports/coverage.xml" | ||
], | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll": true, | ||
"source.organizeImports": true | ||
}, | ||
"editor.formatOnSave": true, | ||
"editor.rulers": [ | ||
100 | ||
], | ||
"editor.tabSize": 4, | ||
"files.autoSave": "onFocusChange", | ||
"[python]": { | ||
"editor.defaultFormatter": "charliermarsh.ruff" | ||
}, | ||
"[toml]": { | ||
"editor.formatOnSave": false | ||
}, | ||
"mypy-type-checker.importStrategy": "fromEnvironment", | ||
"python.defaultInterpreterPath": "/opt/vespadb-env/bin/python", | ||
"python.terminal.activateEnvironment": false, | ||
"python.testing.pytestEnabled": true, | ||
"remote.containers.copyGitConfig": true, | ||
"ruff.importStrategy": "fromEnvironment", | ||
"ruff.logLevel": "warn", | ||
"terminal.integrated.defaultProfile.linux": "zsh", | ||
"terminal.integrated.profiles.linux": { | ||
"zsh": { | ||
"path": "/usr/bin/zsh" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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,7 @@ | ||
# Exclude files and directories from the build context. | ||
# https://docs.docker.com/engine/reference/builder/#dockerignore-file | ||
.mypy_cache/ | ||
.pytest_cache/ | ||
.ruff_cache/ | ||
.git/ | ||
tests/ |
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,14 @@ | ||
version: 2 | ||
|
||
updates: | ||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: monthly | ||
versioning-strategy: lockfile-only | ||
allow: | ||
- dependency-type: "all" |
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,40 @@ | ||
name: Push to ghcr.io | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
build_and_push: | ||
name: Build and push | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
- name: Set Build Timestamp | ||
run: echo "BUILD_TIMESTAMP=$(date +'%Y-%m-%dT%H:%M:%S:%z')" >> $GITHUB_ENV | ||
- name: Log in to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v5 | ||
env: | ||
BUILD_BRANCH: ${{ github.head_ref || github.ref_name }} | ||
with: | ||
context: . | ||
target: app | ||
push: true | ||
build-args: | | ||
BUILD_BRANCH=${{ env.BUILD_BRANCH }} | ||
BUILD_COMMIT=${{ github.sha }} | ||
BUILD_TIMESTAMP=${{ env.BUILD_TIMESTAMP }} | ||
tags: | | ||
ghcr.io/${{ github.repository }}:latest | ||
ghcr.io/${{ github.repository }}:${{ env.BUILD_BRANCH }} |
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,74 @@ | ||
# By default, GitHub Actions don't have permission to write to the ghcr.io registry. | ||
# - Go to: Settings (of this repository) -> Actions -> General -> Workflow permissions | ||
# - Enable: Read and write permissions | ||
name: Lint and Test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
pull_request: | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11.6" ] | ||
name: Python ${{ matrix.python-version }} | ||
env: | ||
TAG: devcontainer-${{ matrix.python-version }}-${{ github.head_ref || github.ref_name }} | ||
steps: | ||
# https://github.com/actions/checkout | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# Add an empty .env file. | ||
# The devcontainers/ci build action fails when the docker-compose.yml file references an .env file that does not exist. | ||
- name: Touch .env | ||
run: touch .env | ||
|
||
# https://github.com/docker/login-action | ||
- name: Log in to registry | ||
uses: docker/login-action@v3 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# https://github.com/devcontainers/ci | ||
- name: Build DevContainer | ||
uses: devcontainers/[email protected] | ||
env: | ||
PYTHON_VERSION: ${{ matrix.python-version }} | ||
with: | ||
imageName: ghcr.io/${{ github.repository }} | ||
cacheFrom: ghcr.io/${{ github.repository }}:${{ env.TAG }} | ||
imageTag: ${{ env.TAG }} | ||
push: always | ||
|
||
- name: Run lint | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }}:${{ env.TAG }} | ||
push: never | ||
runCmd: poe lint | ||
|
||
- name: Run test | ||
uses: devcontainers/[email protected] | ||
with: | ||
cacheFrom: ghcr.io/${{ github.repository }}:${{ env.TAG }} | ||
push: never | ||
runCmd: poe test | ||
|
||
# https://github.com/codecov/codecov-action | ||
- name: Upload coverage | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
files: reports/coverage.xml | ||
env: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: false | ||
verbose: true |
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.