-
-
Notifications
You must be signed in to change notification settings - Fork 29
105 lines (87 loc) · 2.85 KB
/
ci.yaml
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
name: CI
on:
push:
branches:
- 'test/**'
- develop
tags:
- v*
pull_request:
branches:
- develop
workflow_dispatch:
inputs: {}
jobs:
alpine:
runs-on: ubuntu-22.04
if: "!(
startsWith(github.event.head_commit.message, 'docs:') ||
startsWith(github.event.head_commit.message, 'ci:') ||
startsWith(github.event.head_commit.message, 'chore:') ||
startsWith(github.event.head_commit.message, 'style:')
)"
strategy:
fail-fast: true
max-parallel: 10
matrix:
# 5.2 and 5.2.9 are same in bash docker image
BASHVER: ['4.0', '4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2']
steps:
- uses: actions/checkout@v4
- run: BASHVER=${{ matrix.BASHVER }} BUILD_DIST=true PULL_IMAGE=true ./tools/test-in-docker
host:
if: "!(
startsWith(github.event.head_commit.message, 'docs:') ||
startsWith(github.event.head_commit.message, 'ci:') ||
startsWith(github.event.head_commit.message, 'chore:') ||
startsWith(github.event.head_commit.message, 'style:')
)"
strategy:
fail-fast: true
max-parallel: 10
matrix:
os: ['ubuntu-22.04', 'macos-13']
# Bash 4.0 has bug on MacOS. https://github.com/adoyle-h/lobash/blob/develop/docs/with-lower-version-bash.md#not-test-with-bash-40
BASHVER: ['4.1', '4.2', '4.3', '4.4', '5.0', '5.1', '5.2', '5.2.9']
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Init
run: |
echo "PWD: $PWD"
echo "ACT: ${{ env.ACT }}"
- name: Cache test/fixture
if: ${{ !env.ACT }}
id: cache-test-fixture
uses: actions/cache@v4
with:
path: |
tests/fixture/assert
tests/fixture/bats
tests/fixture/bats-file
tests/fixture/support
key: ${{ runner.os }}-test-fixture
- name: Cache bash
if: ${{ !env.ACT }}
id: cache-bash
uses: actions/cache@v4
with:
path: ./tmp/bash-${{ matrix.BASHVER }}
key: ${{ runner.os }}-bash-${{ matrix.BASHVER }}
- name: Update git submodules
if: steps.cache-test-fixture.outputs.cache-hit != 'true'
run:
git submodule update --init --recursive
- name: Install bash
if: steps.cache-bash.outputs.cache-hit != 'true'
run: |
BASHVER=${{ matrix.BASHVER }} ./tools/install-bash
- name: To build ./dist/lobash.bash
run: |
export PATH="${{ github.workspace }}/tmp/bash-${{ matrix.BASHVER }}/bin:$PATH"
bash --version
./build -m "${{ matrix.BASHVER }}" ./dist/
- name: Start to test
run: |
export PATH="${{ github.workspace }}/tmp/bash-${{ matrix.BASHVER }}/bin:$PATH"
OS=${{ matrix.os }} CI=true ./test -d