-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (65 loc) · 2.83 KB
/
Copy pathci.yml
File metadata and controls
76 lines (65 loc) · 2.83 KB
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
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ${{ matrix.os }}
container: ${{ matrix.container }}
name: ${{ matrix.label }}
defaults:
run:
shell: bash
# Mirror alexzhangs/xsh's shell matrix: bash 3.2 / 4.4 / 5.x + zsh 5.x.
# Utilities run under zsh's ksh emulation (provided by xsh >= 0.7.0).
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, container: '', shell_path: /bin/bash, label: bash-5.x-linux }
- { os: macos-latest, container: '', shell_path: /bin/bash, label: bash-3.2-macos }
- { os: macos-latest, container: '', shell_path: brew, label: bash-5.x-macos }
- { os: ubuntu-latest, container: rockylinux:8, shell_path: /bin/bash, label: bash-4.4-linux }
- { os: macos-latest, container: '', shell_path: /bin/zsh, label: zsh-5.x-macos }
- { os: ubuntu-latest, container: '', shell_path: /usr/bin/zsh, label: zsh-5.x-linux }
steps:
- name: Pre-install git (rockylinux container)
if: matrix.container != ''
run: dnf install -y git
- name: Install dependencies (rockylinux container)
if: matrix.container != ''
run: |
dnf install -y --allowerasing coreutils
dnf install -y gawk sed file findutils diffutils procps-ng which tar gzip python3
command -v python >/dev/null 2>&1 || ln -sf "$(command -v python3)" /usr/local/bin/python
git config --global --add safe.directory '*'
- name: Install zsh (Linux)
if: matrix.container == '' && runner.os == 'Linux' && contains(matrix.shell_path, 'zsh')
run: sudo apt-get update && sudo apt-get install -y zsh
- name: Install Homebrew bash (macOS bash 5.x)
if: matrix.shell_path == 'brew'
run: |
brew install bash
echo "SHELL_PATH=$(brew --prefix)/bin/bash" >> "$GITHUB_ENV"
- name: Set shell path
if: matrix.shell_path != 'brew'
run: echo "SHELL_PATH=${{ matrix.shell_path }}" >> "$GITHUB_ENV"
- name: Install xsh
run: |
git clone --depth=50 --branch=master https://github.com/alexzhangs/xsh.git /tmp/xsh
bash /tmp/xsh/install.sh
- name: Load dependency library xsh-lib/core
run: |
source ~/.xshrc
xsh load xsh-lib/core
- name: Load library from current branch
run: |
source ~/.xshrc
# Fork PRs fall back to the default branch (the source branch isn't on
# the main repo).
xsh load -b "${{ github.head_ref || github.ref_name }}" xsh-lib/git || xsh load xsh-lib/git
- name: Run tests (${{ matrix.label }})
run: |
"$SHELL_PATH" ~/.xsh/repo/xsh-lib/git/test.sh