From 12ab185b22af6f0f0109f9147cf895ac632e8c59 Mon Sep 17 00:00:00 2001 From: Martin Bernstorff Date: Sun, 15 Oct 2023 11:47:47 +0000 Subject: [PATCH] simplify ci --- .devcontainer/devcontainer.json | 3 +- .github/workflows/static_type_checks.yml | 30 --------------- .github/workflows/tests.yml | 37 ------------------- .../{pre-commit.yml => validate.yml} | 2 +- makefile | 5 ++- 5 files changed, 7 insertions(+), 70 deletions(-) delete mode 100644 .github/workflows/static_type_checks.yml delete mode 100644 .github/workflows/tests.yml rename .github/workflows/{pre-commit.yml => validate.yml} (97%) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index d1c36a5a..ab3d5111 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -15,7 +15,8 @@ "charliermarsh.ruff", "ms-python.black-formatter", "ms-azuretools.vscode-docker", - "ms-vscode.makefile-tools" + "ms-vscode.makefile-tools", + "github.vscode-github-actions" ] } }, diff --git a/.github/workflows/static_type_checks.yml b/.github/workflows/static_type_checks.yml deleted file mode 100644 index b619acf8..00000000 --- a/.github/workflows/static_type_checks.yml +++ /dev/null @@ -1,30 +0,0 @@ -# We do not include static_type_checks as a pre-commit hook because pre-commit hooks -# are installed in their own virtual environment, so static_type_checks cannot -# use stubs from imports -name: static_type_checks - -jobs: - build: - concurrency: - group: "${{ github.workflow }} @ ${{ github.ref }}" - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Checkout (GitHub) - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Pre-build dev container image - uses: devcontainers/ci@v0.3 - with: - imageName: ghcr.io/MartinBernstorff/personal-mnemonic-medium/ - cacheFrom: ghcr.io/MartinBernstorff/personal-mnemonic-medium/ - push: never - runCmd: - make type-check \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml deleted file mode 100644 index 83173447..00000000 --- a/.github/workflows/tests.yml +++ /dev/null @@ -1,37 +0,0 @@ -# This workflow will install Python dependencies, run pytests and run notebooks -# then it will in python 3.9 (ubuntu-latest) create a badge with the coverage -# and add it to the PR. This badge will be updated if the PR is updated. - -name: Tests -on: - push: - branches: [main] - pull_request: - branches: [main] - - -jobs: - build: - concurrency: - group: "${{ github.workflow }} @ ${{ github.ref }}" - cancel-in-progress: true - runs-on: ubuntu-latest - steps: - - name: Checkout (GitHub) - uses: actions/checkout@v3 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v2 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Pre-build dev container image - uses: devcontainers/ci@v0.3 - with: - imageName: ghcr.io/MartinBernstorff/personal-mnemonic-medium/ - cacheFrom: ghcr.io/MartinBernstorff/personal-mnemonic-medium/ - push: never - runCmd: - make test \ No newline at end of file diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/validate.yml similarity index 97% rename from .github/workflows/pre-commit.yml rename to .github/workflows/validate.yml index fa4e9cf8..e5eca8f3 100644 --- a/.github/workflows/pre-commit.yml +++ b/.github/workflows/validate.yml @@ -32,4 +32,4 @@ jobs: cacheFrom: ghcr.io/MartinBernstorff/personal-mnemonic-medium/ push: never runCmd: - make lint \ No newline at end of file + make validate \ No newline at end of file diff --git a/makefile b/makefile index 120a0803..8f4fac02 100644 --- a/makefile +++ b/makefile @@ -7,8 +7,11 @@ test: type-check: pyright . -pr: +validate: make lint & make test & make type-check + +pr: + make validate git push gh pr create gh pr merge --auto --merge \ No newline at end of file