-
-
Notifications
You must be signed in to change notification settings - Fork 12
94 lines (91 loc) · 2.99 KB
/
testing.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
name: Shell Testing
on:
pull_request:
branches: [ master ]
paths:
- '**.sh'
- '**.bats'
- '.github/workflows/testing.yml'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
checkout-code:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- uses: pre-commit/action@v3.0.0
- uses: pre-commit-ci/lite-action@v1.0.1
if: always()
unit:
needs: [checkout-code]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13 ]
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get -qq update && sudo apt-get -qq install attr kcov
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install --quiet kcov diffutils grep coreutils
- name: Install bats-core
run: |
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
- name: Install bats extras
run: |
git clone https://github.com/bats-core/bats-assert.git
git clone https://github.com/bats-core/bats-support.git
git clone https://github.com/bats-core/bats-file.git
- name: Run bats tests
run: make test-ci
- name: Coverage report
if: runner.os == 'Linux'
run: |
kcov --include-path=src /tmp/coverage bats tests/*.bats
cp $(find /tmp/coverage -type f -name 'cobertura.xml') cobertura.xml
- name: Upload test results to Codecov
if: runner.os == 'Linux'
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
integration:
needs: [unit]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13 ]
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt-get update -qq && sudo apt-get install -qq wget curl
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install --quiet wget curl
- name: Install using wget
run: |
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/sp1thas/dropboxignore/master/src/utils/install.sh)"
dropboxignore version
sudo rm /usr/local/bin/dropboxignore
sudo rm -rf /usr/local/lib/dropboxignore
- name: Install using curl
run: |
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/sp1thas/dropboxignore/master/src/utils/install.sh)"
dropboxignore version
sudo rm /usr/local/bin/dropboxignore
sudo rm -rf /usr/local/lib/dropboxignore
- name: Install from source
run: |
sudo make install
dropboxignore version
- name: Uninstall
run: sudo make uninstall