Skip to content

Use docker for testing #172

Use docker for testing

Use docker for testing #172

Workflow file for this run

name: Shell Testing
on:
pull_request:
branches: [ master ]
paths:
- '**.sh'
- '**.bats'
- '.github/workflows/testing.yml'
env:
HOMEBREW_NO_AUTO_UPDATE: 1
jobs:
checkout-code:
steps:

Check failure on line 16 in .github/workflows/testing.yml

View workflow run for this annotation

GitHub Actions / Shell Testing

Invalid workflow file

The workflow is not valid. .github/workflows/testing.yml (Line: 16, Col: 5): Required property is missing: runs-on
- uses: pre-commit/[email protected]
- uses: pre-commit-ci/[email protected]
if: always()
unit:
needs: [checkout-code]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13 ]
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install attr kcov
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install kcov diffutils grep coreutils
- name: Install bats-core
run: |
git clone https://github.com/bats-core/bats-core.git
cd bats-core
sudo ./install.sh /usr/local
- name: Install bats extras
run: |
git clone https://github.com/bats-core/bats-assert.git libs/bats-assert
git clone https://github.com/bats-core/bats-support.git libs/bats-support
git clone https://github.com/bats-core/bats-file.git libs/bats-file
- name: Run bats tests
run: make shell-tests
- name: Coverage report
if: runner.os == 'Linux'
run: |
kcov --include-path=src /tmp/coverage bats tests/*.bats
cp $(find /tmp/coverage -type f -name 'cobertura.xml') coverage.xml
- uses: codecov/codecov-action@v3
if: runner.os == 'Linux'
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
integration:
needs: [unit]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-22.04, macos-13 ]
steps:
- uses: actions/checkout@v3
- name: Install Linux dependencies
if: runner.os == 'Linux'
run: sudo apt update && sudo apt install wget curl
- name: Install macOS dependencies
if: runner.os == 'macOS'
run: brew install wget curl
- name: Install using wget
run: |
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/sp1thas/dropboxignore/master/src/utils/install.sh)"
dropboxignore version
sudo rm /usr/local/bin/dropboxignore
sudo rm -rf /usr/local/lib/dropboxignore
- name: Install using curl
run: |
sudo sh -c "$(curl -fsSL https://raw.githubusercontent.com/sp1thas/dropboxignore/master/src/utils/install.sh)"
dropboxignore version
sudo rm /usr/local/bin/dropboxignore
sudo rm -rf /usr/local/lib/dropboxignore
- name: Install from source
run: |
sudo make install
dropboxignore version
- name: Uninstall
run: sudo make uninstall