From 713e4d7e737123b5cd09fa4663ab01792b07db1f Mon Sep 17 00:00:00 2001 From: nicholasSSUSE Date: Tue, 26 Nov 2024 13:20:21 -0300 Subject: [PATCH] migrating to self-hosted runners: pull-request.yaml jobs --- .github/workflows/build.yaml | 49 ++++++++++++++ .../{charts-release.yaml => checkpoints.yaml} | 4 +- .github/workflows/pull-request.yaml | 66 ------------------- 3 files changed, 51 insertions(+), 68 deletions(-) create mode 100755 .github/workflows/build.yaml rename .github/workflows/{charts-release.yaml => checkpoints.yaml} (89%) delete mode 100755 .github/workflows/pull-request.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100755 index 0000000000..e6b10f189e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,49 @@ +name: Build + +on: + pull_request: + branches: + - dev-v* + - release-v* + +jobs: + build: + name: Validate + runs-on: org-${{ github.repository_owner_id }}-linux-k8s + steps: + - name: Checkout base branch + uses: actions/checkout@v4 + + - name: Checkout PR + run: gh pr checkout ${{ github.event.pull_request.number }} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Checkout into branch + run: git checkout -b staging-pr-workflow + + - name: Pull scripts + run: make pull-scripts + + - name: Check release.yaml + run: make check-release-yaml + + - name: Validate + run: | + if [[ "${{ github.ref }}" == refs/heads/release-v* ]]; then + echo "Validating remote release branch" + make validate remote=true + else + echo "Validating local branch" + make validate + fi + + - name: Check container images + run: make check-images + env: + DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} + DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} + + - name: Check RC images and charts + run: make check-rc + if: contains(github.base_ref, 'release-v') diff --git a/.github/workflows/charts-release.yaml b/.github/workflows/checkpoints.yaml similarity index 89% rename from .github/workflows/charts-release.yaml rename to .github/workflows/checkpoints.yaml index 4ff92eae77..87cd9f9b87 100644 --- a/.github/workflows/charts-release.yaml +++ b/.github/workflows/checkpoints.yaml @@ -1,4 +1,4 @@ -name: Charts-Release-Validations +name: Checkpoints on: pull_request: @@ -7,7 +7,7 @@ on: jobs: build: - name: Checkpoint 0 - release.yaml validation + name: 1 - release.yaml validation runs-on: ubuntu-latest steps: - name: Checkout base branch diff --git a/.github/workflows/pull-request.yaml b/.github/workflows/pull-request.yaml deleted file mode 100755 index 20c06ed3b7..0000000000 --- a/.github/workflows/pull-request.yaml +++ /dev/null @@ -1,66 +0,0 @@ -name: CI-pullrequest - -on: - pull_request: - branches: - - dev-v* - - release-v* - -jobs: - build: - name: Build - runs-on: ubuntu-latest - steps: - - name: Checkout base branch - uses: actions/checkout@v4 - - - name: Checkout PR - run: gh pr checkout ${{ github.event.pull_request.number }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Checkout into branch - run: git checkout -b staging-pr-workflow - - - name: Pull scripts - run: sudo make pull-scripts - - - name: Check release.yaml - run: sudo make check-release-yaml - - - name: Validate - run: sudo make validate remote=true - - check-images: - name: Check Container Images - runs-on: ubuntu-latest - steps: - - name: Checkout base branch - uses: actions/checkout@v4 - - - name: Checkout PR - run: gh pr checkout ${{ github.event.pull_request.number }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check container images - run: make check-images - env: - DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} - DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} - - check-rc: - name: Check RC Images and Charts - runs-on: ubuntu-latest - steps: - - name: Checkout base branch - uses: actions/checkout@v4 - - - name: Checkout PR - run: gh pr checkout ${{ github.event.pull_request.number }} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Check RC images and charts - run: make check-rc - if: startsWith(github.ref, 'refs/heads/release-v')