Skip to content

Commit 2a6b262

Browse files
authored
Merge pull request #13 from FaithKovi/faith-ci/cd
Create CI/CD pipeline to test installation
2 parents e9cd086 + 8d89920 commit 2a6b262

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

.github/workflows/tests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Test bot installation script on different operating systems
2+
on:
3+
push:
4+
branches: all
5+
pull_request:
6+
branches: [ main ]
7+
8+
workflow_dispatch:
9+
10+
defaults:
11+
run:
12+
shell: bash
13+
14+
jobs:
15+
test:
16+
name: Test bot script on ${{ matrix.os }} with ${{ matrix.compiler }}.
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
matrix:
20+
os: [ubuntu-latest, macos-latest]
21+
compiler: [ g++-10 ]
22+
include:
23+
- os: ubuntu-latest
24+
compiler: g++-10
25+
target: Linux
26+
27+
- os: macos-latest
28+
compiler: g++-10
29+
target: Macos
30+
31+
- os: windows-latest
32+
compiler: cl
33+
target: Windows
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
- name: Run shell script
38+
run: |
39+
chmod +x install.sh
40+
./install.sh
41+

install.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ while true; do
1111
echo -e "\xE2\x9D\x8C please input your password to proceed so that the setup runs successfully"
1212
echo
1313

14-
if sudo apt update && sudo apt install -y git gh curl nodejs npm; then
14+
if type -p curl >/dev/null || (sudo apt update && sudo apt install -y curl ) && curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg && sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg && echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null && sudo apt update && sudo apt install gh -y && sudo apt install -y git nodejs npm; then
1515
echo
1616
break
1717
else

0 commit comments

Comments
 (0)