-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (76 loc) · 2.4 KB
/
ci.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
name: 'ci'
on:
push:
branches: [main, dev, ci/*]
pull_request:
branches: [main, dev, ci/*]
permissions: read-all
# env:
defaults:
run:
shell: bash
working-directory: ./
jobs:
test-linux:
name: 'Linux Test'
strategy:
fail-fast: false
matrix:
os: ['ubuntu-20.04'] # ubuntu-18.04, ubuntu-20.04, ubuntu-latest
bash-version: ['4.3', '4.4', '5.0', 'latest']
runs-on: '${{ matrix.os }}'
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install Bats
run: |
subdir='.workflow-data'
bats_version='1.4.1'
curl -LsSo "$subdir/bats-core.tar.gz" --create-dirs \
https://github.com/bats-core/bats-core/archive/v$bats_version.tar.gz
tar --extract --transform "s,bats-core-$bats_version,bats-core," -C "$subdir" -f "$subdir/bats-core.tar.gz"
- name: Build image
run: |
docker build \
--build-arg bash_version=${{ matrix.bash-version }} \
--tag basalt:bash-${{ matrix.bash-version }} \
.
- name: Run tests
run: |
time docker run basalt:bash-${{ matrix.bash-version }} \
--tap tests
test-mac:
name: 'MacOS Test'
strategy:
fail-fast: false
matrix:
os: ['macos-10.15'] # macos-10.15, macos-11, macos-latest
runs-on: '${{ matrix.os }}'
steps:
- uses: 'actions/checkout@v2'
with:
submodules: true
path: 'source'
- name: Install Prerequisites
run: |
# gnu-tar is only for the 'Install Bats' step
brew install bash coreutils curl gnu-tar
- name: Install Bats
run: |
subdir='.workflow-data'
bats_version='1.4.1'
cd source
curl -LsSo "$subdir/bats-core.tar.gz" --create-dirs \
https://github.com/bats-core/bats-core/archive/v$bats_version.tar.gz
gtar --extract --transform "s,bats-core-$bats_version,bats-core," -C "$subdir" -f "$subdir/bats-core.tar.gz"
- name: Run tests
run: |
subdir='.workflow-data'
cd source
bash --version
git config --global user.email "[email protected]"
git config --global user.name "User Name"
printf "%s\n" "---"
time "./$subdir/bats-core/bin/bats" --tap tests