From 99cf32a43371966f39bac42948c130e2932f68a6 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 4 Nov 2024 17:37:50 +1000 Subject: [PATCH] Remove github actions --- .github/workflows/build-and-push.yml | 41 ---------------------------- .github/workflows/build-image.yml | 26 ------------------ .github/workflows/run-tests.yml | 21 +++++++++++--- .tekton/rapidast-pull-request.yaml | 3 +- 4 files changed, 18 insertions(+), 73 deletions(-) delete mode 100644 .github/workflows/build-and-push.yml delete mode 100644 .github/workflows/build-image.yml diff --git a/.github/workflows/build-and-push.yml b/.github/workflows/build-and-push.yml deleted file mode 100644 index f1974b0..0000000 --- a/.github/workflows/build-and-push.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Build and push container image - -env: - IMAGE_NAME: "rapidast" - IMAGE_TAGS: "${{ github.sha }}" - IMAGE_REGISTRY: quay.io/redhatproductsecurity - IMAGE_REGISTRY_USER: ${{ secrets.IMAGE_REGISTRY_USER }} - IMAGE_REGISTRY_PASSWORD: ${{ secrets.IMAGE_REGISTRY_PASSWORD }} - -on: - push: - branches: ["development", "main"] - -jobs: - - build-and-push: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - # https://github.com/redhat-actions/buildah-build#readme - - name: Build container image - id: build-image - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_TAGS }} - dockerfiles: | - ./containerize/Containerfile - - # https://github.com/redhat-actions/push-to-registry#readme - - name: Push to registry - id: push-image - uses: redhat-actions/push-to-registry@v2 - with: - image: ${{ steps.build-image.outputs.image }} - tags: ${{ steps.build-image.outputs.tags }} - registry: ${{ env.IMAGE_REGISTRY }} - username: ${{ env.IMAGE_REGISTRY_USER }} - password: ${{ env.IMAGE_REGISTRY_PASSWORD }} diff --git a/.github/workflows/build-image.yml b/.github/workflows/build-image.yml deleted file mode 100644 index e1ce7f9..0000000 --- a/.github/workflows/build-image.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Build container image - -env: - IMAGE_NAME: "rapidast" - IMAGE_TAGS: "${{ github.sha }}" - -on: - pull_request: - branches: ["development", "main"] - -jobs: - - build-image: - - runs-on: ubuntu-latest - - # https://github.com/redhat-actions/buildah-build#readme - steps: - - uses: actions/checkout@v4 - - name: Build container image - uses: redhat-actions/buildah-build@v2 - with: - image: ${{ env.IMAGE_NAME }} - tags: ${{ env.IMAGE_TAGS }} - dockerfiles: | - ./containerize/Containerfile diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index b43b9b3..c9f8e8a 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -10,8 +10,24 @@ permissions: contents: read jobs: - test: + lint: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Set up Python 3.9 + uses: actions/setup-python@v3 + with: + python-version: "3.9" + - name: Install dependencies + run: | + python3 -m ensurepip --upgrade + pip install --no-cache-dir -r requirements.txt -r requirements-dev.txt + - name: Lint with pre-commit hook + run: | + pre-commit run --all-files --show-diff-on-failure + unit-tests: runs-on: ubuntu-latest steps: @@ -27,6 +43,3 @@ jobs: - name: Test with pytest run: | pytest tests - - name: Lint with pre-commit hook - run: | - pre-commit run --all-files --show-diff-on-failure diff --git a/.tekton/rapidast-pull-request.yaml b/.tekton/rapidast-pull-request.yaml index 302955c..404eefe 100644 --- a/.tekton/rapidast-pull-request.yaml +++ b/.tekton/rapidast-pull-request.yaml @@ -7,8 +7,7 @@ metadata: build.appstudio.redhat.com/pull_request_number: '{{pull_request_number}}' build.appstudio.redhat.com/target_branch: '{{target_branch}}' pipelinesascode.tekton.dev/max-keep-runs: "3" - pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && target_branch - == "development" + pipelinesascode.tekton.dev/on-cel-expression: event == "pull_request" && (target_branch == "development" || target_branch == "main") creationTimestamp: null labels: appstudio.openshift.io/application: rapidast