-
Notifications
You must be signed in to change notification settings - Fork 0
35 lines (28 loc) · 974 Bytes
/
test-verify.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
name: Test bpt
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest
env:
BASH_UNIT_VER: v2.1.0
SHFMT_VER: v3.6.0
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Cache Dependencies
id: cache-deps
uses: actions/cache@v3
with:
path: deps
key: deps-1-${{ env.BASH_UNIT_VER }}-${{env.SHFMT_VER}}
- name: Install dependencies
run: |
mkdir deps && cd deps
curl -k -sSL "https://raw.githubusercontent.com/pgrange/bash_unit/${BASH_UNIT_VER}/install.sh" | bash
curl -k -sSL "https://github.com/mvdan/sh/releases/download/${SHFMT_VER}/shfmt_${SHFMT_VER}_linux_amd64" -o shfmt
chmod +x shfmt
if: steps.cache-deps.outputs.cache-hit != 'true'
- name: Check script formatting
run: ./deps/shfmt -d -i 4 bpt.sh test/test-*
- name: Run Tests
run: ./deps/bash_unit -f tap test/test-*