forked from akusei/pushover-bash
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (59 loc) · 2.13 KB
/
bash.yml
File metadata and controls
75 lines (59 loc) · 2.13 KB
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
name: CI Bash
on:
push:
branches: [ main ]
pull_request:
branches:
- '*'
permissions:
contents: read
# TODO: Mock the actual call to pushover, instead of actually doing it.
jobs:
run_fail:
name: Bash - Expect fail
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Script permissions
run: chmod +x ./pushover.sh
- name: Run script expect fail
#continue-on-error: true
run: |
./pushover.sh -v -t badtoken -u badkey -d baddevice -T Github Action Fail -m Github Action Fail || (( $? == 3 )) && exit 0 || exit $?
run_cli:
name: Bash - Run with Arguments
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Script permissions
run: chmod +x ./pushover.sh
- name: Run script with Args
run: |
./pushover.sh -v -p -2 -t ${{ secrets.PUSHOVER_APP }} -u ${{ secrets.PUSHOVER_USER }} -d ${{ secrets.PUSHOVER_DEVICE }} -T Github Action Args -m Github Action Args
run_config:
name: Bash - Run with Config File
runs-on: ubuntu-22.04
steps:
- name: Git checkout
uses: actions/checkout@v3
- name: Script permissions
run: chmod +x ./pushover.sh
- name: Setup Config file
run: |
cp ./.github/assets/pushover-config-test ./pushover-config
sed -i "s#__PUSHOVER_USER__#${{ secrets.PUSHOVER_USER }}#g" ./pushover-config
sed -i "s#__PUSHOVER_APP__#${{ secrets.PUSHOVER_APP }}#g" ./pushover-config
sed -i "s#__PUSHOVER_DEVICE__#${{ secrets.PUSHOVER_DEVICE }}#g" ./pushover-config
- name: Validate with config
run: ./pushover.sh -v -x -m Github Action Config
# Eventually move these to a test script.
- name: Run script from config, priority 2
run: ./pushover.sh -v -m Github Action Config -p -2
- name: Run script from config, priority 1
run: ./pushover.sh -v -m Github Action Config -p -1
- name: Run script with bad priority
#continue-on-error: true
run: |
./pushover.sh -v -m Github Action Bad Priority -p A || (( $? == 4 )) && exit 0 || exit $?