From 12d63afb8addbd5e8b6dce4f62a70f17a7784f93 Mon Sep 17 00:00:00 2001 From: Fabian von Feilitzsch Date: Mon, 11 Dec 2023 10:46:47 -0500 Subject: [PATCH] Add global CI Signed-off-by: Fabian von Feilitzsch --- .github/workflows/global-ci.yaml | 58 ++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 .github/workflows/global-ci.yaml diff --git a/.github/workflows/global-ci.yaml b/.github/workflows/global-ci.yaml new file mode 100644 index 0000000..84f8882 --- /dev/null +++ b/.github/workflows/global-ci.yaml @@ -0,0 +1,58 @@ +name: Global CI + +on: ["push", "pull_request", "workflow_dispatch"] + +jobs: + build-addon: + name: Build tackle2-addon-analyzer + runs-on: ubuntu-20.04 + strategy: + fail-fast: false + steps: + - name: Extract pull request number from PR description + id: extract_analyzer_pull_request_number + run: | + PULL_REQUEST_NUMBER=$(echo "${{ github.event.pull_request.body }}" | grep -oP '[A|a]nalyzer.?[P|p][R|r]: \K\d+' || true) + if [ -z "$PULL_REQUEST_NUMBER" ]; then + echo "::set-output name=ref::main" + else + echo "::set-output name=ref::refs/pull/$PULL_REQUEST_NUMBER/merge" + fi + - name: checkout + uses: actions/checkout@v3 + - name: Checkout tools repo + uses: actions/checkout@v3 + with: + repository: konveyor/analyzer-lsp + path: analyzer-lsp + ref: "${{ steps.extract_analyzer_pull_request_number.outputs.ref }}" + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + repository: konveyor/tackle2-addon-analyzer + ref: main + path: tackle2-addon-analyzer + + - name: Build bundle base image + run: | + docker build -t quay.io/konveyor/jdtls-server-base:latest . + - name: build analyzer-lsp Dockerfile + run: | + docker build -f analyzer-lsp/Dockerfile -t quay.io/konveyor/analyzer-lsp:latest analyzer-lsp + docker tag quay.io/konveyor/analyzer-lsp:latest analyzer-lsp + - name: Build addon and save image + working-directory: tackle2-addon-analyzer + run: | + IMG=quay.io/konveyor/tackle2-addon-analyzer:latest make image-podman + podman save -o /tmp/tackle2-addon-analyzer.tar quay.io/konveyor/tackle2-addon-analyzer:latest + - name: Upload image as artifact + uses: actions/upload-artifact@v3 + with: + name: tackle2-addon-analyzer + path: /tmp/tackle2-addon-analyzer.tar + retention-days: 1 + e2e: + needs: build-addon + uses: konveyor/ci/.github/workflows/global-ci.yml@main + with: + component_name: tackle2-addon-analyzer