| 1 |
--- |
| 2 |
name: build |
| 3 |
|
| 4 |
on: |
| 5 |
push: |
| 6 |
branches: [ master, devel ] |
| 7 |
pull_request: |
| 8 |
branches: [ master, devel ] |
| 9 |
workflow_dispatch: |
| 10 |
|
| 11 |
permissions: |
| 12 |
contents: read |
| 13 |
|
| 14 |
env: |
| 15 |
LANG: C.UTF-8 |
| 16 |
|
| 17 |
jobs: |
| 18 |
build: |
| 19 |
runs-on: ubuntu-24.04 |
| 20 |
steps: |
| 21 |
- uses: actions/checkout@v7 |
| 22 |
with: |
| 23 |
fetch-depth: 0 |
| 24 |
|
| 25 |
- name: Set up Go |
| 26 |
uses: actions/setup-go@v7 |
| 27 |
with: |
| 28 |
go-version: "1.23" |
| 29 |
|
| 30 |
- name: Setup Ruby |
| 31 |
uses: ruby/setup-ruby@95ef2b042f9d7a56d8268cba8559e2842e2ad01b # v1 |
| 32 |
with: |
| 33 |
ruby-version: 3.4.6 |
| 34 |
|
| 35 |
- name: Install packages |
| 36 |
run: | |
| 37 |
sudo install -d -m 0755 /etc/apt/keyrings |
| 38 |
wget -qO- https://apt.fury.io/nushell/gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/fury-nushell.gpg |
| 39 |
echo "deb [signed-by=/etc/apt/keyrings/fury-nushell.gpg] https://apt.fury.io/nushell/ /" | sudo tee /etc/apt/sources.list.d/fury-nushell.list |
| 40 |
sudo apt-get update |
| 41 |
# Pinned: 0.115.0 runs external completers on a background thread, so |
| 42 |
# fzf never receives keystrokes. https://github.com/nushell/nushell/issues/18771 |
| 43 |
sudo apt-get install --yes zsh fish tmux shfmt nushell=0.114.1-0 |
| 44 |
|
| 45 |
- name: Install Ruby gems |
| 46 |
run: bundle install |
| 47 |
|
| 48 |
- name: Rubocop |
| 49 |
run: make lint |
| 50 |
|
| 51 |
- name: Unit test |
| 52 |
run: make test |
| 53 |
|
| 54 |
- name: Fuzz test |
| 55 |
run: | |
| 56 |
go test ./src/algo/ -fuzz=FuzzIndexByteTwo -fuzztime=5s |
| 57 |
go test ./src/algo/ -fuzz=FuzzLastIndexByteTwo -fuzztime=5s |
| 58 |
|
| 59 |
- name: Integration test |
| 60 |
run: make install && ./install --all && tmux new-session -d && ruby test/runner.rb --verbose |