forked from duglin/xreg-github
-
Notifications
You must be signed in to change notification settings - Fork 0
102 lines (94 loc) · 3.99 KB
/
github-actions-apeiora-ows3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
name: GitHub Actions ApeiroRA OWS3
run-name: ${{ github.actor }} is testing out apeirora GitHub Actions
on: [push]
jobs:
ApeiroRA-OWS3-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- run: echo "🎉 The job is running on a ${{ runner.os }} server and was automatically triggered by a ${{ github.event_name }} event."
- run: echo "🔎 The name of the branch is ${{ github.ref }} and repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "💡 The ${{ github.repository }} repository has been cloned to the runner."
- name: Run tests using make
run: make tmptest
- name: Check and install make
run: |
if ! command -v make &> /dev/null
then
echo "make could not be found, installing..."
sudo apt-get update
sudo apt-get install -y make
else
echo "make is already installed"
fi
- name: Check and install kubectl
run: |
if ! command -v kubectl &> /dev/null
then
echo "kubectl could not be found, installing..."
curl -Lo kubectl https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl
chmod +x kubectl
sudo mv kubectl /usr/local/bin/
else
echo "kubectl is already installed"
fi
- name: Check and install uuidgen and then set GCTL_SESSION_ID
run: |
if ! command -v uuidgen &> /dev/null
then
echo "uuidgen could not be found, installing..."
sudo apt-get update
sudo apt-get install -y uuid-runtime
else
echo "uuidgen is already installed"
fi
echo "GCTL_SESSION_ID=$(uuidgen)" >> $GITHUB_ENV
- name: Check and install brew, gardenctl and kubelogin; publish afterwards
run: |
if ! command -v brew &> /dev/null
then
echo "brew could not be found, installing..."
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
(echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/runner/.bashrc
eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
echo 'export PATH="${BREW_ROOT:-$HOME/linuxbrew/.linuxbrew}/bin:$PATH"' >> $GITHUB_ENV
echo 'export PATH="${BREW_ROOT:-$HOME/linuxbrew/.linuxbrew}/sbin:$PATH"' >> $GITHUB_ENV
else
echo "brew is already installed"
fi
if ! command -v gardenctl &> /dev/null
then
echo "gardenctl could not be found, installing..."
brew install gardener/tap/gardenctl-v2
echo 'export PATH="${GARDENCTL_ROOT:-$HOME/linuxbrew/.linuxbrew}/bin/gardenctl:$PATH"' >> $GITHUB_ENV
else
echo "gardenctl is already installed"
fi
if ! command -v gardenlogin &> /dev/null
then
echo "gardenlogin could not be found, installing..."
brew install gardener/tap/gardenlogin
else
echo "gardenlogin is already installed"
fi
if ! command -v kubelogin &> /dev/null
then
echo "kubelogin could not be found, installing..."
brew install int128/kubelogin/kubelogin
else
echo "kubelogin is already installed"
fi
make k8
env:
GARDEN_OWS3_PATH: ${{ secrets.GARDEN_OWS3_PATH }}
K8_CLUSTER_PATH: ${{ secrets.K8_CLUSTER_PATH }}
ARTIFACTORY_USER: ${{ secrets.ARTIFACTORY_USER }}
ARTIFACTORY_TOKEN: ${{ secrets.ARTIFACTORY_TOKEN }}
JF_URL: ${{ secrets.JF_URL }}
# - name: Apply Kubernetes configuration
# run: |
# make k8-apply
# env:
# K8_CLUSTER_PATH: ${{ secrets.K8_CLUSTER_PATH }}
- run: echo "🍏 This job's status is ${{ job.status }}."