Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
nkononov committed May 31, 2024
0 parents commit 02fcb6e
Show file tree
Hide file tree
Showing 8,220 changed files with 2,208,314 additions and 0 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
57 changes: 57 additions & 0 deletions .github/workflows/docker-image-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build Docker Image - CI

on:
release:
types:
- published
push:
branches:
- main
- 'release-\d.\d\d'

jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
run:
uses: docker/setup-qemu-action@v3

- name: Set image tag
shell: bash
run: |
image_tag=latest
if [ ${{ github.ref }} != 'refs/heads/main' ]; then
branch=${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}
version_digits=$(echo ${branch} | tr -d -c 0-9)
image_tag=v$(echo ${version_digits} | cut -b 1).$(echo ${version_digits:1}).0
fi
echo "IMAGE_TAG=${image_tag}" >> $GITHUB_OUTPUT
id: set_image_tag

- name: Build docker image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: eco-gotests
tags: ${{ steps.set_image_tag.outputs.IMAGE_TAG }}
containerfiles: |
./Dockerfile
archs: amd64, arm64

- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ocp-edge-qe
username: ${{ secrets.OCP_EDGE_QE_QUAY_USER }}
password: ${{ secrets.OCP_EDGE_QE_QUAY }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
42 changes: 42 additions & 0 deletions .github/workflows/docker-image-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Build Docker Image - Manual

on:
workflow_dispatch:
inputs:
tag:
description: 'Docker image tag ("-unstable" postfix wil be add to every tag)'
required: true

jobs:
build:
name: Build and push docker image
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Build docker image
id: build-image
uses: redhat-actions/buildah-build@v2
with:
image: eco-gotests
tags: ${{ github.event.inputs.tag }}-unstable
containerfiles: |
./Dockerfile
archs: amd64, arm64

- name: Push To quay.io
id: push-to-quay
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build-image.outputs.image }}
tags: ${{ steps.build-image.outputs.tags }}
registry: quay.io/ocp-edge-qe
username: ${{ secrets.OCP_EDGE_QE_QUAY_USER }}
password: ${{ secrets.OCP_EDGE_QE_QUAY }}

- name: Print image url
run: echo "Image pushed to ${{ steps.push-to-quay.outputs.registry-paths }}"
59 changes: 59 additions & 0 deletions .github/workflows/eco-goinfra-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: 'Eco-GoInfra Module Bump'
on:
workflow_dispatch:
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
jobs:
main:
name: Eco-goinfra module bump
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup agent and add repo ssh key
run: |
echo "${{ secrets.REPO_ACCESS_KEY }}" > ~/eco-gotests.id_rsa
chmod 0600 ~/eco-gotests.id_rsa
ssh-agent -a $SSH_AUTH_SOCK > /dev/null
ssh-add ~/eco-gotests.id_rsa
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.11

- name: Check for eco-goinfra module updates
id: new_mods
env:
ECO_GOTESTS_CLONE_URL: [email protected]:openshift-kni/eco-gotests.git
run: |
git remote set-url origin $ECO_GOTESTS_CLONE_URL
git pull origin
if [[ ! `git branch -a | grep eco-goinfra-dep-bump` ]]; then
git config user.name 'GitHub Actions'
git config user.email '[email protected]'
go get github.com/openshift-kni/eco-goinfra
go mod tidy
go mod vendor
fi
if [[ ! -z `git diff-index --name-only HEAD --` ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "Nothing to update"
fi
- name: Push changes to new branch
if: steps.new_mods.outputs.changed == 'true'
run: |
export MODULE=$(go list -m -f '{{.Version}}' github.com/openshift-kni/eco-goinfra)
git checkout -b eco-goinfra-dep-bump-$MODULE
git add go.mod go.sum vendor
git commit -m "deps: bumping eco-goinfra module to ${MODULE}"
git push origin eco-goinfra-dep-bump-$MODULE
- name: Cleanup ssh-agent
if: always()
run: |
ssh-add -D
rm -f ~/eco-gotests.id_rsa || true
36 changes: 36 additions & 0 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Makefile CI

on:
workflow_dispatch:

push:

pull_request:
branches:
- main
- 'release-\d.\d\d'

jobs:
build:
runs-on: ubuntu-latest
env:
SHELL: /bin/bash

steps:
- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.11

- uses: actions/checkout@v3

- name: Run lint
run: make lint

- name: Install
run: make install-ginkgo

- name: Run ginkgo Dry Run
run: ginkgo run -vv -r --dry-run ./tests/
env:
ECO_DRY_RUN: true
17 changes: 17 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

.idea
reports
.vscode

Loading

0 comments on commit 02fcb6e

Please sign in to comment.