diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 0000000..757eea3 --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,37 @@ +name: Coverage + +on: + push: + paths: + - 'src/*' + - 'tests/*' + workflow_dispatch: + +jobs: + coverage: + name: Run tests coverage + runs-on: ubuntu-latest + steps: + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.0.0 + - name: Install shellspec + run: | + mkdir -p ~/shellspec + cd ~/shellspec + git clone https://github.com/shellspec/shellspec.git + ln -s ~/shellspec/shellspec/shellspec /usr/local/bin/shellspec + echo -n "shellspec version: " + shellspec --version + - name: Install kcov + run: | + apt install -y kcov + - name: Checkout Code + uses: actions/checkout@v4 + - name: Run tests + run: | + bash shellspec --kcov + - name: Upload coverage + uses: actions/upload-artifact@v4 + with: + name: coverage + path: coverage