-
-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (51 loc) · 1.69 KB
/
test.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
name: Test
on:
pull_request:
branches:
- main
- 'feature/**'
push:
branches:
- main
env:
BATS_LIB_PATH: "./node_modules"
jobs:
test-shell:
strategy:
matrix:
os:
- ubuntu-latest
- ubuntu-20.04
- ubuntu-22.04
- macos-11
- macos-12
- macos-13
runs-on: ${{ matrix.os }}
steps:
- name: Install current Bash on macOS
if: startsWith(matrix.os, 'macos-')
run: brew install bash
- uses: actions/checkout@v4
- run: git config --global user.name "Test user" && git config --global user.email "someone@example.com"
- uses: actions/setup-node@v4
- uses: luizm/action-sh-checker@v0.8.0
if: matrix.os == 'ubuntu-latest'
env:
SHFMT_OPTS: -i 2 -ci -s -d
- run: npm install
- run: wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz && tar -xf kcov-amd64.tar.gz && sudo mv ./usr/local/bin/kcov /usr/local/bin/kcov && kcov --version
if: matrix.os == 'ubuntu-latest'
- name: Run Tests and Code Coverage on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: kcov --clean --include-pattern=.bash --bash-parse-files-in-dir=. --exclude-path=node_modules,vendor,coverage $(pwd)/coverage ./node_modules/.bin/bats tests
shell: bash
- name: Upload coverage reports to Codecov
if: matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
directory: ./coverage
fail_ci_if_error: true
- name: Run Tests on other OSes
if: matrix.os != 'ubuntu-latest'
run: ./node_modules/.bin/bats tests
shell: bash