mirror of
https://github.com/nocodb/nocodb.git
synced 2026-05-02 02:57:06 +00:00
chore: created GitHub actions to run tests
This commit is contained in:
55
.github/workflows/bats-test.yml
vendored
Normal file
55
.github/workflows/bats-test.yml
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Run BATS Tests
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- 'docker-compose/setup-script/noco.sh'
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
matrix: ${{ steps.set-matrix.outputs.matrix }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install jq
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y jq
|
||||
|
||||
- name: Prepare matrix for test files
|
||||
id: set-matrix
|
||||
run: |
|
||||
BATS_FILES=$(find docker-compose/setup-script/tests -name '*.bats')
|
||||
MATRIX_JSON=$(echo $BATS_FILES | jq -Rsc 'split("\n") | map(select(. != ""))')
|
||||
echo "matrix=$MATRIX_JSON" >> $GITHUB_ENV
|
||||
|
||||
test:
|
||||
needs: prepare
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
test: ${{fromJson(env.matrix)}}
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install BATS
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y bats expect
|
||||
|
||||
- name: Get working directory
|
||||
run: |
|
||||
WORKING_DIR="$(pwd)/docker-compose/setup-script/tests"
|
||||
echo "WORKING_DIR=$WORKING_DIR" >> $GITHUB_ENV
|
||||
|
||||
- name: Run BATS test
|
||||
run: bats ${{ matrix.test }}
|
||||
env:
|
||||
WORKING_DIR: ${{ env.WORKING_DIR }}
|
||||
SKIP_TARE_DOWN: true
|
||||
Reference in New Issue
Block a user