зеркало из https://github.com/Azure/ARO-RP.git
added github action for go ci (#2212)
This commit is contained in:
Родитель
fc656bc7a8
Коммит
05ee165220
|
@ -0,0 +1,25 @@
|
|||
name: ci-go
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
branches:
|
||||
- master
|
||||
pull_request:
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ci-from-docker:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
- name: build from buildah
|
||||
uses: redhat-actions/buildah-build@v2
|
||||
with:
|
||||
image: test-image
|
||||
tags: ${{ github.sha }}
|
||||
context: .
|
||||
containerfiles: ./Dockerfile.ci
|
|
@ -0,0 +1,36 @@
|
|||
FROM registry.access.redhat.com/ubi8/go-toolset:1.17.7
|
||||
|
||||
USER root
|
||||
RUN mkdir -p /root/go/src/github.com/Azure/ARO-RP
|
||||
WORKDIR /root/go/src/github.com/Azure/ARO-RP
|
||||
ENV GOPATH=/root/go
|
||||
|
||||
#we have multiple steps for copy so we can make use of caching
|
||||
COPY vendor/ vendor
|
||||
|
||||
COPY docs/ docs
|
||||
COPY hack/ hack
|
||||
|
||||
COPY swagger/ swagger
|
||||
COPY test/ test
|
||||
COPY python/ python
|
||||
COPY portal/ portal
|
||||
|
||||
COPY cmd/ cmd
|
||||
COPY pkg/ pkg
|
||||
|
||||
#COPY all files with an extension (directories not copied)
|
||||
COPY ?*.* .
|
||||
COPY Makefile LICENSE .
|
||||
|
||||
COPY .git .git
|
||||
COPY .gitignore .gitignore
|
||||
COPY .pipelines .pipelines
|
||||
COPY .gdn .gdn
|
||||
COPY .github .github
|
||||
COPY .env .env
|
||||
COPY .sha256sum .sha256sum
|
||||
COPY .config .config
|
||||
|
||||
RUN hack/ci-utils/build.sh
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
#!/bin/bash
|
||||
|
||||
isClean() {
|
||||
if [[ ! -z "$(git status -s)" ]]
|
||||
then
|
||||
echo "there are some modified files"
|
||||
git status
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
set -xe
|
||||
|
||||
make generate
|
||||
isClean
|
||||
make build-all
|
||||
isClean
|
||||
make unit-test-go
|
||||
isClean
|
Загрузка…
Ссылка в новой задаче