Skip to content

Commit

Permalink
Add a temporary github action for v2 branch (#738)
Browse files Browse the repository at this point in the history
Signed-off-by: Ahmed ElSayed <[email protected]>
  • Loading branch information
ahmelsayed authored and Zbynek Roubalik committed Apr 16, 2020
1 parent e3e0c58 commit cb248a4
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 7 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/v2-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: master build
on:
push:
branches:
- v2
jobs:
validate:
name: Validate
runs-on: ubuntu-latest
# build-tools is built from ../../tools/build-tools.Dockerfile
container: kedacore/build-tools:v2
steps:
- name: Check out code
uses: actions/checkout@v1
with:
fetch-depth: 1

- name: Go modules cache
uses: actions/cache@v1
with:
path: /go/pkg
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Test
run: make test

- name: Login to Docker Hub
env:
DOCKER_HUB_ACCESS_TOKEN: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
DOCKER_HUB_USERNAME: ${{ secrets.DOCKER_HUB_USERNAME }}
run: echo $DOCKER_HUB_ACCESS_TOKEN | docker login -u $DOCKER_HUB_USERNAME --password-stdin

- name: Publish
run: make publish

- name: Run end to end tests
env:
AZURE_SUBSCRIPTION: ${{ secrets.AZURE_SUBSCRIPTION }}
AZURE_RESOURCE_GROUP: ${{ secrets.AZURE_RESOURCE_GROUP }}
AZURE_SP_ID: ${{ secrets.AZURE_SP_ID }}
AZURE_SP_KEY: ${{ secrets.AZURE_SP_KEY }}
AZURE_SP_TENANT: ${{ secrets.AZURE_SP_TENANT }}
TEST_STORAGE_CONNECTION_STRING: ${{ secrets.TEST_STORAGE_CONNECTION_STRING }}
run: make e2e-test
13 changes: 6 additions & 7 deletions tools/build-tools.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,16 @@ RUN apt-get update && \

# Install azure-cli
RUN apt-get install apt-transport-https lsb-release software-properties-common dirmngr -y && \
curl -sL https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor | \
tee /etc/apt/trusted.gpg.d/microsoft.asc.gpg > /dev/null && \
AZ_REPO=$(lsb_release -cs) && \
echo "deb [arch=amd64] https://packages.microsoft.com/repos/azure-cli/ $AZ_REPO main" | \
tee /etc/apt/sources.list.d/azure-cli.list && \
apt-key --keyring /etc/apt/trusted.gpg.d/Microsoft.gpg adv \
--keyserver packages.microsoft.com \
--recv-keys BC528686B50D79E339D3721CEB3E94ADBE1229CF && \
apt-get update && \
apt-get install -y azure-cli

# Install docker client
RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-19.03.2.tgz && \
RUN curl -LO https://download.docker.com/linux/static/stable/x86_64/docker-19.03.2.tgz && \
docker_sha256=865038730c79ab48dfed1365ee7627606405c037f46c9ae17c5ec1f487da1375 && \
echo "$docker_sha256 docker-19.03.2.tgz" | sha256sum -c - && \
tar xvzf docker-19.03.2.tgz && \
Expand All @@ -25,15 +24,15 @@ RUN wget https://download.docker.com/linux/static/stable/x86_64/docker-19.03.2.t

# Install golang
RUN GO_VERSION=1.13.3 && \
wget https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
curl -LO https://dl.google.com/go/go${GO_VERSION}.linux-amd64.tar.gz && \
go_sha256=0804bf02020dceaa8a7d7275ee79f7a142f1996bfd0c39216ccb405f93f994c0 && \
echo "$go_sha256 go${GO_VERSION}.linux-amd64.tar.gz" | sha256sum -c - && \
tar -C /usr/local -xvzf go${GO_VERSION}.linux-amd64.tar.gz && \
rm -rf go${GO_VERSION}.linux-amd64.tar.gz

# Install helm/tiller
RUN HELM_VERSION=v2.16.1 && \
wget https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz && \
curl -LO https://get.helm.sh/helm-${HELM_VERSION}-linux-amd64.tar.gz && \
helm_sha256=7eebaaa2da4734242bbcdced62cc32ba8c7164a18792c8acdf16c77abffce202 && \
echo "$helm_sha256 helm-${HELM_VERSION}-linux-amd64.tar.gz" | sha256sum -c - && \
tar xzvf helm-${HELM_VERSION}-linux-amd64.tar.gz && \
Expand All @@ -56,7 +55,7 @@ RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - && \
RUN RELEASE_VERSION=v0.16.0 && \
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \
curl -LO https://github.com/operator-framework/operator-sdk/releases/download/${RELEASE_VERSION}/operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc && \
gpg --keyserver keyserver.ubuntu.com --recv-key 0CF50BEE7E4DF6445E08C0EA9AFDE59E90D2B445 && \
gpg --keyserver keyserver.ubuntu.com --recv-key 7CC439CD21EE1031C3831C6590354A3F09FCE996 && \
gpg --verify operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu.asc && \
chmod +x operator-sdk-${RELEASE_VERSION}-x86_64-linux-gnu && \
mkdir -p /usr/local/bin/ && \
Expand Down

0 comments on commit cb248a4

Please sign in to comment.