-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(actions): add github workflows for test
Signed-off-by: Dentrax <[email protected]> Signed-off-by: Batuhan Apaydın <[email protected]>
- Loading branch information
1 parent
30c5ee5
commit d6b4661
Showing
9 changed files
with
141 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: [ * ] | ||
pull_request: | ||
branches: [ master ] | ||
|
||
env: | ||
IP: 127.0.0.1 | ||
|
||
jobs: | ||
lint: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.13.x ] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
version: v1.29 | ||
test-swarm: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.13.x ] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: create swarm cluster | ||
run: ./contrib/create_swarm_cluster.sh | ||
- name: deploy stack | ||
run: ./contrib/deploy_stack.sh | ||
- name: wait 15 seconds | ||
run: sleep 15 | ||
- name: test swarm | ||
run: make test-swarm | ||
env: | ||
OPENFAAS_URL: http://${{ env.IP }}:8080/ | ||
- name: clean swarm cluster | ||
run: ./contrib/clean_swarm_cluster.sh | ||
test-kubernetes: | ||
strategy: | ||
matrix: | ||
go-version: [ 1.13.x ] | ||
os: [ ubuntu-latest ] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@master | ||
with: | ||
fetch-depth: 1 | ||
- name: Install Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
- name: get tools | ||
run: ./contrib/get_tools.sh | ||
- name: create kubernetes cluster | ||
run: ./contrib/create_kubernetes_cluster.sh | ||
- name: deploy openfaas | ||
run: ./contrib/deploy_openfaas.sh | ||
- name: test kubernetes | ||
run: make test-kubernetes | ||
env: | ||
OPENFAAS_URL: http://${{ env.IP }}:31112/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo ">>> Leaving Swarm cluster" | ||
|
||
docker swarm leave --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
USER_NAME=$(whoami) | ||
|
||
echo ">>> Creating kubernetes cluster" | ||
k3sup install --local --ip $IP --user $USER_NAME |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo ">>> Creating Swarm cluster" | ||
|
||
docker swarm init |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
USER_NAME=$(whoami) | ||
KUBECONFIG_FOLDER_PATH=/home/$USER_NAME/.kube | ||
KUBECONFIG_PATH=$KUBECONFIG_FOLDER_PATH/config | ||
KUBECONFIG=$KUBECONFIG_PATH | ||
|
||
echo ">>> Setup kubectl configuration" | ||
mkdir -p $KUBECONFIG_FOLDER_PATH | ||
cp `pwd`/kubeconfig $KUBECONFIG_PATH | ||
|
||
echo ">>> Installing openfaas" | ||
arkade install openfaas --basic-auth=false | ||
|
||
echo ">>> Waiting for helm install to complete." | ||
kubectl rollout status -n openfaas deploy/gateway -w |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo ">>> Cloning the faas project" | ||
git clone https://github.com/openfaas/faas.git | ||
|
||
echo ">>> Deploying the stack" | ||
cd faas && echo "$(pwd)" && ./deploy_stack.sh --no-auth && cd .. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
KUBE_VERSION=v1.18.8 | ||
|
||
echo ">>> Installing k3sup" | ||
sudo curl -sLS https://get.k3sup.dev | sh | ||
sudo install k3sup /usr/local/bin/ | ||
|
||
echo ">>> Installing kubectl $KUBE_VERSION" | ||
OS=linux | ||
curl -sSLfo kubectl https://storage.googleapis.com/kubernetes-release/release/$KUBE_VERSION/bin/$OS/amd64/kubectl && \ | ||
chmod +x kubectl && \ | ||
sudo mv kubectl /usr/local/bin/ | ||
|
||
echo ">>> Installing arkade" | ||
curl -sLS https://dl.get-arkade.dev | sudo sh |