Add yamlfmt precommit hook (#2584)
Co-authored-by: Shuchang Zheng <wintonzheng0325@gmail.com>
This commit is contained in:
13
.github/workflows/build-docker-image.yml
vendored
13
.github/workflows/build-docker-image.yml
vendored
@@ -1,42 +1,34 @@
|
||||
name: Build Docker Image and Push to ECR
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [ published ]
|
||||
|
||||
types: [published]
|
||||
env:
|
||||
AWS_REGION: us-east-1
|
||||
ECR_BACKEND_REPOSITORY: skyvern
|
||||
ECR_UI_REPOSITORY: skyvern-ui
|
||||
REGISTRY_ALIAS: skyvern # t6d4b5t4
|
||||
|
||||
jobs:
|
||||
run-ci:
|
||||
uses: ./.github/workflows/ci.yml
|
||||
|
||||
build-docker-image:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [ run-ci ]
|
||||
needs: [run-ci]
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Configure AWS credentials
|
||||
uses: aws-actions/configure-aws-credentials@v4
|
||||
with:
|
||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||
aws-region: ${{ env.AWS_REGION }}
|
||||
|
||||
- name: Login to Amazon ECR Public
|
||||
id: login-ecr-public
|
||||
uses: aws-actions/amazon-ecr-login@v2
|
||||
with:
|
||||
registry-type: public
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
|
||||
- name: Build, tag, and push backend image to Amazon Public ECR
|
||||
id: build-image
|
||||
uses: docker/build-push-action@v2
|
||||
@@ -52,7 +44,6 @@ jobs:
|
||||
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.sha }}
|
||||
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:${{ github.event.release.tag_name }}
|
||||
${{ env.ECR_REGISTRY}}/${{ env.REGISTRY_ALIAS }}/${{ env.ECR_BACKEND_REPOSITORY }}:latest
|
||||
|
||||
- name: Build, tag, and push ui image to Amazon Public ECR
|
||||
id: build-ui-image
|
||||
uses: docker/build-push-action@v2
|
||||
|
||||
22
.github/workflows/ci.yml
vendored
22
.github/workflows/ci.yml
vendored
@@ -1,5 +1,4 @@
|
||||
name: Run tests and pre-commit
|
||||
|
||||
# Run this job on pushes to `main`, and for pull requests. If you don't specify
|
||||
# `branches: [main], then this actions runs _twice_ on pull requests, which is
|
||||
# annoying.
|
||||
@@ -8,12 +7,10 @@ on:
|
||||
pull_request:
|
||||
push:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: Run tests and pre-commit hooks
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
# Service containers to run with `container-job`
|
||||
services:
|
||||
# Label used to access the service container
|
||||
@@ -27,23 +24,17 @@ jobs:
|
||||
POSTGRES_HOST_AUTH_METHOD: trust
|
||||
# Set health checks to wait until postgres has started
|
||||
options: >-
|
||||
--health-cmd pg_isready
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
--health-retries 5
|
||||
--health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
||||
ports:
|
||||
# Maps tcp port 5432 on service container to the host
|
||||
- 5432:5432
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
|
||||
# reference the matrixe python version here.
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
|
||||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
|
||||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
|
||||
@@ -54,7 +45,6 @@ jobs:
|
||||
with:
|
||||
path: ~/.local
|
||||
key: poetry-1.7.1
|
||||
|
||||
# Install Poetry. You could do this manually, or there are several actions that do this.
|
||||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
|
||||
# Poetry's default install script, which feels correct. I pin the Poetry version here
|
||||
@@ -69,7 +59,6 @@ jobs:
|
||||
version: 1.7.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
|
||||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
|
||||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
|
||||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
|
||||
@@ -79,19 +68,16 @@ jobs:
|
||||
with:
|
||||
path: .venv
|
||||
key: pydeps-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
# Install dependencies. `--no-root` means "install all dependencies but not the project
|
||||
# itself", which is what you want to avoid caching _your_ code. The `if` statement
|
||||
# ensures this only runs on a cache miss.
|
||||
- run: poetry install --no-interaction --no-root
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
|
||||
# Now install _your_ project. This isn't necessary for many types of projects -- particularly
|
||||
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
|
||||
# pyproject.toml and makes that if you add things like console-scripts at some point that
|
||||
# they'll be installed and working.
|
||||
- run: poetry install --no-interaction
|
||||
|
||||
# Finally, run pre-commit.
|
||||
- name: Run all pre-commit hooks
|
||||
uses: pre-commit/action@v3.0.0
|
||||
@@ -105,7 +91,6 @@ jobs:
|
||||
AZURE_GPT4O_MINI_API_VERSION: "dummy"
|
||||
AWS_REGION: "us-east-1"
|
||||
ENABLE_BEDROCK: "true"
|
||||
|
||||
- name: Run alembic check
|
||||
env:
|
||||
ENABLE_OPENAI: "true"
|
||||
@@ -123,7 +108,6 @@ jobs:
|
||||
ENABLE_OPENAI: "true"
|
||||
OPENAI_API_KEY: "sk-dummy"
|
||||
run: poetry run pytest tests
|
||||
|
||||
fe-lint-build:
|
||||
name: Frontend Lint and Build
|
||||
runs-on: ubuntu-latest
|
||||
@@ -133,17 +117,13 @@ jobs:
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Install Node.js dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Run linter
|
||||
run: npm run lint
|
||||
|
||||
- name: Run build
|
||||
run: npm run build
|
||||
|
||||
8
.github/workflows/codeflash.yaml
vendored
8
.github/workflows/codeflash.yaml
vendored
@@ -1,17 +1,14 @@
|
||||
name: Codeflash
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
paths:
|
||||
# So that this workflow only runs when code within the target module is modified
|
||||
- "skyvern/**"
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
# Any new push to the PR will cancel the previous run, so that only the latest code is optimized
|
||||
group: ${{ github.workflow }}-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
optimize:
|
||||
name: Optimize new Python code in this PR
|
||||
@@ -21,7 +18,6 @@ jobs:
|
||||
env:
|
||||
CODEFLASH_API_KEY: ${{ secrets.CODEFLASH_API_KEY }}
|
||||
CODEFLASH_PR_NUMBER: ${{ github.event.number }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
@@ -44,5 +40,5 @@ jobs:
|
||||
poetry env use python
|
||||
poetry run codeflash
|
||||
- name: remove test dir
|
||||
run: |
|
||||
rm -rf codeflash-tests
|
||||
run: |-
|
||||
rm -rf codeflash-tests
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
name: Close inactive issues
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
|
||||
workflow_dispatch:
|
||||
jobs:
|
||||
close-issues:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
43
.github/workflows/n8n-ci.yml
vendored
43
.github/workflows/n8n-ci.yml
vendored
@@ -1,37 +1,30 @@
|
||||
name: Run n8n package CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'integrations/n8n/**'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
branches: [main]
|
||||
paths:
|
||||
- 'integrations/n8n/**'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
|
||||
- name: Install dependencies
|
||||
working-directory: integrations/n8n
|
||||
run: pnpm install --frozen-lockfile
|
||||
|
||||
- name: Build and Lint
|
||||
working-directory: integrations/n8n
|
||||
run: pnpm prepublishOnly
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up Node.js
|
||||
uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version-file: .nvmrc
|
||||
- name: Install pnpm
|
||||
uses: pnpm/action-setup@v2
|
||||
with:
|
||||
version: 9
|
||||
run_install: false
|
||||
- name: Install dependencies
|
||||
working-directory: integrations/n8n
|
||||
run: pnpm install --frozen-lockfile
|
||||
- name: Build and Lint
|
||||
working-directory: integrations/n8n
|
||||
run: pnpm prepublishOnly
|
||||
|
||||
6
.github/workflows/publish-fern-docs.yml
vendored
6
.github/workflows/publish-fern-docs.yml
vendored
@@ -1,10 +1,8 @@
|
||||
name: Publish Fern Docs
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
run:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,12 +10,10 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install Fern
|
||||
run: npm install -g fern-api
|
||||
|
||||
- name: Publish Docs
|
||||
env:
|
||||
FERN_TOKEN: ${{ secrets.FERN_TOKEN }}
|
||||
POSTHOG_API_KEY: ${{ secrets.POSTHOG_API_KEY }}
|
||||
run: fern generate --docs
|
||||
run: fern generate --docs
|
||||
|
||||
16
.github/workflows/sdk-release.yml
vendored
16
.github/workflows/sdk-release.yml
vendored
@@ -1,5 +1,4 @@
|
||||
name: Build Skyvern SDK and publish to PyPI
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
@@ -7,7 +6,6 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- 'pyproject.toml'
|
||||
|
||||
jobs:
|
||||
check-version-change:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -17,7 +15,6 @@ jobs:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2
|
||||
|
||||
- name: Check if version changed
|
||||
id: check
|
||||
run: |
|
||||
@@ -35,12 +32,10 @@ jobs:
|
||||
echo "Version remained at $CURRENT_VERSION"
|
||||
echo "version_changed=false" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
run-ci:
|
||||
needs: check-version-change
|
||||
if: needs.check-version-change.outputs.version_changed == 'true'
|
||||
uses: ./.github/workflows/ci.yml
|
||||
|
||||
build-sdk:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [check-version-change, run-ci]
|
||||
@@ -48,13 +43,11 @@ jobs:
|
||||
steps:
|
||||
- name: Check out Git repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
# If you wanted to use multiple Python versions, you'd have specify a matrix in the job and
|
||||
# reference the matrixe python version here.
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: "3.11"
|
||||
|
||||
# Cache the installation of Poetry itself, e.g. the next step. This prevents the workflow
|
||||
# from installing Poetry every time, which can be slow. Note the use of the Poetry version
|
||||
# number in the cache key, and the "-0" suffix: this allows you to invalidate the cache
|
||||
@@ -65,7 +58,6 @@ jobs:
|
||||
with:
|
||||
path: ~/.local
|
||||
key: poetry-1.7.1
|
||||
|
||||
# Install Poetry. You could do this manually, or there are several actions that do this.
|
||||
# `snok/install-poetry` seems to be minimal yet complete, and really just calls out to
|
||||
# Poetry's default install script, which feels correct. I pin the Poetry version here
|
||||
@@ -80,7 +72,6 @@ jobs:
|
||||
version: 1.7.1
|
||||
virtualenvs-create: true
|
||||
virtualenvs-in-project: true
|
||||
|
||||
# Cache your dependencies (i.e. all the stuff in your `pyproject.toml`). Note the cache
|
||||
# key: if you're using multiple Python versions, or multiple OSes, you'd need to include
|
||||
# them in the cache key. I'm not, so it can be simple and just depend on the poetry.lock.
|
||||
@@ -90,27 +81,22 @@ jobs:
|
||||
with:
|
||||
path: .venv
|
||||
key: pydeps-${{ hashFiles('**/poetry.lock') }}
|
||||
|
||||
# Install dependencies. `--no-root` means "install all dependencies but not the project
|
||||
# itself", which is what you want to avoid caching _your_ code. The `if` statement
|
||||
# ensures this only runs on a cache miss.
|
||||
- run: poetry install --no-interaction --no-root
|
||||
if: steps.cache-deps.outputs.cache-hit != 'true'
|
||||
|
||||
# Now install _your_ project. This isn't necessary for many types of projects -- particularly
|
||||
# things like Django apps don't need this. But it's a good idea since it fully-exercises the
|
||||
# pyproject.toml and makes that if you add things like console-scripts at some point that
|
||||
# they'll be installed and working.
|
||||
- run: poetry install --no-interaction
|
||||
|
||||
- name: Clean dist directory
|
||||
run: rm -rf dist
|
||||
|
||||
- name: Build Package
|
||||
run: poetry build
|
||||
|
||||
- name: Publish to PyPI
|
||||
env:
|
||||
TWINE_USERNAME: __token__
|
||||
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
|
||||
run: poetry run twine upload --repository pypi dist/*
|
||||
run: poetry run twine upload --repository pypi dist/*
|
||||
|
||||
2
.github/workflows/update-openapi.yml
vendored
2
.github/workflows/update-openapi.yml
vendored
@@ -1,10 +1,8 @@
|
||||
name: Update OpenAPI Specification
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
- cron: "0 0 * * *"
|
||||
|
||||
jobs:
|
||||
update-openapi:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
8
.github/workflows/version-bump.yml
vendored
8
.github/workflows/version-bump.yml
vendored
@@ -1,9 +1,7 @@
|
||||
name: Version Bump on Release
|
||||
|
||||
on:
|
||||
release:
|
||||
types: [published]
|
||||
|
||||
jobs:
|
||||
update-version:
|
||||
runs-on: ubuntu-latest
|
||||
@@ -12,17 +10,14 @@ jobs:
|
||||
pull-requests: write
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Extract version from release
|
||||
id: get_version
|
||||
run: |
|
||||
VERSION=${GITHUB_REF#refs/tags/v}
|
||||
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||
|
||||
- name: Update version in pyproject.toml
|
||||
run: |
|
||||
sed -i "s/version = \".*\"/version = \"${{ steps.get_version.outputs.version }}\"/" pyproject.toml
|
||||
|
||||
- name: Create Pull Request
|
||||
id: create-pr
|
||||
uses: peter-evans/create-pull-request@v6
|
||||
@@ -32,10 +27,9 @@ jobs:
|
||||
body: "Auto-generated PR to update version in pyproject.toml"
|
||||
branch: "version-bump/${{ steps.get_version.outputs.version }}"
|
||||
delete-branch: true
|
||||
|
||||
- name: Enable Pull Request Automerge
|
||||
if: steps.create-pr.outputs.pull-request-number
|
||||
run: |
|
||||
gh pr merge --auto --merge "${{ steps.create-pr.outputs.pull-request-number }}"
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
Reference in New Issue
Block a user