From 0bd93bc706dfccdd6991b95a8ed8c685dbf3da4d Mon Sep 17 00:00:00 2001 From: Arthur Diniz Date: Sat, 7 Dec 2024 14:58:03 +0000 Subject: [PATCH] Create pipeline for tests and shellcheck Closes: #29 Signed-off-by: Arthur Diniz --- .github/workflows/test.yml | 46 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..9b4a76b --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,46 @@ +name: Tests + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install tools + run: sudo apt-get update && sudo apt-get install -y shellcheck devscripts + + - name: Run shellcheck + run: shellcheck wcurl tests/* + + - name: Run checkbashisms + run: checkbashisms wcurl tests/* + + test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, macos-latest] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install shunit2 + run: | + if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then + sudo apt-get update + sudo apt-get install -y shunit2 + elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then + brew install shunit2 + fi + + - name: Run shunit2 tests + run: ./tests/tests.sh