blob: 228dfa4b42ef5daae2330175a060d06a53e47e24 [file] [log] [blame]
name: Backend CLI Test
on:
push:
branches:
- master
paths:
- 'api/**'
pull_request:
branches:
- master
paths:
- 'api/**'
jobs:
run-test:
runs-on: ubuntu-latest
strategy:
matrix:
etcd: [3.4.14]
services:
etcd:
image: bitnami/etcd:${{ matrix.etcd }}
ports:
- 2379:2379
- 2380:2380
env:
ALLOW_NONE_AUTHENTICATION: yes
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: cache etcd
id: cache-etcd
uses: actions/cache@v3
with:
path: |
${{ github.workspace }}/api/etcd-v${{ matrix.etcd }}-linux-amd64
key: etcd-v${{ matrix.etcd }}-linux-amd64
- name: download etcd
if: ${{ steps.cache-etcd.outputs.cache-hit != 'true' }}
working-directory: ./api
run: |
wget https://github.com/etcd-io/etcd/releases/download/v${{ matrix.etcd }}/etcd-v${{ matrix.etcd }}-linux-amd64.tar.gz
tar zxvf etcd-v${{ matrix.etcd }}-linux-amd64.tar.gz
- name: install bats
run: |
git clone https://github.com/sstephenson/bats.git && cd bats
sudo ./install.sh /usr/local
- name: run test
working-directory: ./api
run: chmod +x ./test/shell/cli_test.sh && sudo ./test/shell/cli_test.sh
- name: tmate debugger
if: ${{ failure() }}
uses: ./.github/actions/tmate-action