Skip to content

Commit

Permalink
refactoring, checking ifs, adding abort in case of previous errors
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholasSUSE committed Dec 11, 2024
1 parent 01a10bd commit d81f560
Showing 1 changed file with 23 additions and 15 deletions.
38 changes: 23 additions & 15 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
container: registry.suse.com/bci/bci-base:latest
steps:
- name: install dependencies
run: zypper --non-interactive install docker jq git make go awk
run: zypper --non-interactive install docker jq git make go awk yq
- name: install gh
env:
GH_VERSION: 2.63.2
Expand All @@ -22,52 +22,60 @@ jobs:
curl -fsL https://github.com/cli/cli/releases/download/v${GH_VERSION}/gh_${GH_VERSION}_linux_amd64.tar.gz | tar xvzf - --strip-components=1 -C /tmp/gh
mv /tmp/gh/bin/gh /usr/bin/gh
chmod +x /usr/bin/gh
- name: Checkout code
uses: actions/checkout@v4
- name: Git safe directory
run: git config --global --add safe.directory "$PWD"
- name: Set up PATH
run: echo $PATH >> $GITHUB_PATH
run: |
git config --global --add safe.directory "$PWD"
echo $PATH >> $GITHUB_PATH
- name: Checkout base branch
- name: actions/checkout@v4
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
- name: Checkout into new branch (staging-pr-workflow)
run: git checkout -b staging-pr-workflow

- name: Pull scripts
run: make pull-scripts

- name: Check release.yaml
run: make check-release-yaml
continue-on-error: false


- name: Release PR Chekpoints
run: |
if [[ "${{ github.ref }}" == refs/heads/release-v* ]]; then
make validate-release-charts BRANCH=${{ github.event.pull_request.base.ref }} GH_TOKEN=${{ secrets.GITHUB_TOKEN }} PR_NUMBER=${{ github.event.pull_request.number }}
echo "Validating remote release branch"
fi
if: contains(github.base_ref, 'release-v')
run: make validate-release-charts BRANCH=${{ github.event.pull_request.base.ref }} GH_TOKEN=${{ secrets.GITHUB_TOKEN }} PR_NUMBER=${{ github.event.pull_request.number }}
continue-on-error: false

- name: Validate

- name: Validate index.yaml Vs assets/ dir
run: |
echo "github.ref"
echo "${{ github.ref }}"
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
continue-on-error: false


- name: Check container images
run: make check-images
env:
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
continue-on-error: false


- name: Check RC images and charts
run: make check-rc
if: contains(github.base_ref, 'release-v')
run: make check-rc
continue-on-error: false

0 comments on commit d81f560

Please sign in to comment.