| 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.20] |
| |
| steps: |
| - uses: actions/checkout@v3 |
| with: |
| submodules: recursive |
| |
| - name: setup go |
| uses: actions/setup-go@v4 |
| with: |
| go-version: '1.19' |
| |
| - 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 |