-
Notifications
You must be signed in to change notification settings - Fork 1
189 lines (154 loc) · 5.23 KB
/
tests.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
name: Test envr.ps1
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
env:
COLOR_SUCCESS: 1e6e18
COLOR_FAIL: c31f1d
jobs:
test_bash_on_ubuntu:
runs-on: ubuntu-latest
env:
color: c31f1d
steps:
- uses: actions/checkout@v3
- name: Get version
run: echo "version=${BASH_VERSION}" >> $GITHUB_ENV
- name: Test bash on Ubuntu
run: tests/sh/bash.sh
- name: Set success color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $GITHUB_ENV
- name: Make badge
if: success() || failure()
uses: RubbaBoy/[email protected]
with:
NAME: ubuntu_bash
LABEL: bash
STATUS: ${{ env.version }}
COLOR: ${{ env.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test_zsh_on_ubuntu:
runs-on: ubuntu-latest
env:
color: c31f1d
steps:
- uses: actions/checkout@v3
- name: Install zsh
run: sudo apt update && sudo apt install zsh -y
- name: Get version
run: echo "version=$(zsh --version)" >> $GITHUB_ENV
- name: Test zsh on Ubuntu
run: tests/sh/zsh.sh
- name: Set success color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $GITHUB_ENV
- name: Make badge
if: success() || failure()
uses: RubbaBoy/[email protected]
with:
NAME: ubuntu_zsh
LABEL: zsh
STATUS: ${{ env.version }}
COLOR: ${{ env.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
test_ps_core_on_windows:
runs-on: windows-latest
outputs:
color: ${{ steps.set-success-color.outputs.color }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: get-version
shell: pwsh
run: $($_v = $PSVersionTable.PSVersion; echo version=$_v) >> $env:GITHUB_OUTPUT
- name: Test PS Core on Windows
shell: pwsh
run: ./tests/windows/ps.ps1
- id: set-success-color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $env:GITHUB_OUTPUT
test_ps_on_windows:
runs-on: windows-latest
outputs:
color: ${{ steps.set-success-color.outputs.color }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: get-version
shell: powershell
run: $($_v = $PSVersionTable.PSVersion; echo version=$_v) >> $env:GITHUB_OUTPUT
- name: Test PS on Windows
shell: powershell
run: ./tests/windows/ps.ps1
- id: set-success-color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $env:GITHUB_OUTPUT
test_bash_on_mac:
runs-on: macos-latest
outputs:
color: ${{ steps.set-success-color.outputs.color }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: get-version
run: echo "version=${BASH_VERSION}" >> $GITHUB_OUTPUT
- name: Test bash on MacOS
run: tests/sh/bash.sh
- id: set-success-color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $GITHUB_OUTPUT
test_zsh_on_mac:
runs-on: macos-latest
outputs:
color: ${{ steps.set-success-color.outputs.color }}
version: ${{ steps.get-version.outputs.version }}
steps:
- uses: actions/checkout@v3
- id: get-version
run: echo "version=$(zsh --version)" >> $GITHUB_OUTPUT
- name: Test zsh on MacOS
run: tests/sh/zsh.sh
- id: set-success-color
if: success()
run: echo "color=${{ env.COLOR_SUCCESS }}" >> $GITHUB_OUTPUT
make_badges:
if: always()
runs-on: ubuntu-latest
needs: [test_ps_on_windows, test_ps_core_on_windows, test_bash_on_mac, test_zsh_on_mac]
steps:
- uses: actions/checkout@v3
- name: Make Windows PS Core Badge
uses: RubbaBoy/[email protected]
with:
NAME: windows_ps_core
LABEL: PowerShell
STATUS: ${{ needs.test_ps_core_on_windows.outputs.version }}
COLOR: ${{ needs.test_ps_core_on_windows.outputs.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make Windows PS Badge
uses: RubbaBoy/[email protected]
with:
NAME: windows_ps
LABEL: PowerShell
STATUS: ${{ needs.test_ps_on_windows.outputs.version }}
COLOR: ${{ needs.test_ps_on_windows.outputs.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make MacOS bash Badge
uses: RubbaBoy/[email protected]
with:
NAME: mac_bash
LABEL: bash
STATUS: ${{ needs.test_bash_on_mac.outputs.version }}
COLOR: ${{ needs.test_bash_on_mac.outputs.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Make MacOS zsh Badge
uses: RubbaBoy/[email protected]
with:
NAME: mac_zsh
LABEL: zsh
STATUS: ${{ needs.test_zsh_on_mac.outputs.version }}
COLOR: ${{ needs.test_zsh_on_mac.outputs.color }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}