-
Notifications
You must be signed in to change notification settings - Fork 7
80 lines (79 loc) · 2.23 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
name: CI Workflow
on:
- push
jobs:
test:
name: Unit Tests
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
- os: ubuntu-latest
awk: gawk
- os: ubuntu-latest
awk: mawk
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Install Zsh
if: ${{ startsWith(matrix.os, 'ubuntu') }}
run: |
sudo apt-get update
sudo apt-get install -y zsh
- name: Switch awk variant
if: ${{ startsWith(matrix.os, 'ubuntu') && matrix.awk }}
run: |
sudo update-alternatives --set awk /usr/bin/${{ matrix.awk }}
- name: Show versions
run: |
tests/versions.zsh
- name: Run unit tests
run: |
tests/test.zsh --tap --time-limit 30 tests/*.zunit
test-container:
name: Unit Tests (Container)
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- image: ubuntu-16.04
awk: gawk
- image: ubuntu-16.04
awk: mawk
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
submodules: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Build image
id: build
uses: docker/build-push-action@v4
with:
context: tests/_dockerfiles/${{ matrix.image }}
load: true
build-args: |
AWK=${{ matrix.awk }}
- name: Show versions
run: |
docker run \
--rm \
--env=GITHUB_ACTIONS \
--mount=type=bind,source=$(pwd),destination=/fzf-zsh-completions \
--workdir=/fzf-zsh-completions \
'${{ steps.build.outputs.imageid }}' \
tests/versions.zsh
- name: Run unit tests
run: |
docker run \
--rm \
--mount=type=bind,source=$(pwd),destination=/fzf-zsh-completions \
--workdir=/fzf-zsh-completions \
'${{ steps.build.outputs.imageid }}' \
tests/test.zsh --tap --time-limit 30 tests/*.zunit