feat: bash compat compare with null #123
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test | |
on: | |
push: | |
branches: [master] | |
pull_request: | |
branches: [master] | |
jobs: | |
test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@master | |
with: | |
fetch-depth: 1 | |
- name: Environment | |
run: | | |
SUDO_AVAIL=$(if command -v sudo > /dev/null; then echo 1; fi) | |
echo "SUDO_AVAIL=$SUDO_AVAIL" >> $GITHUB_ENV | |
- name: Update repositories | |
run: | | |
${SUDO_AVAIL:+sudo} apt-get update | |
- name: Install dependencies | |
run: | | |
${SUDO_AVAIL:+sudo} apt-get install -y make stow sudo wget curl | |
- name: Cache kcov | |
id: cache-kcov | |
uses: actions/cache@v1 | |
with: | |
path: kcov | |
key: kcov-${{ runner.os }} | |
- name: Install kcov install dependencies | |
run: | | |
${SUDO_AVAIL:+sudo} apt-get install -y libcurl4-openssl-dev \ | |
binutils-dev libiberty-dev libdw-dev | |
- name: Install kcov compile only dependencies | |
if: steps.cache-kcov.outputs.cache-hit != 'true' | |
run: | | |
${SUDO_AVAIL:+sudo} apt-get install -y python3 tar xz-utils \ | |
cmake zlib1g-dev libssl-dev build-essential | |
- name: Build kcov | |
if: steps.cache-kcov.outputs.cache-hit != 'true' | |
run: | | |
wget https://github.com/SimonKagstrom/kcov/archive/master.tar.gz | |
tar xzf master.tar.gz | |
mv kcov-master kcov | |
cd kcov | |
mkdir -p build | |
cd build | |
cmake .. | |
make | |
- name: Install Kcov | |
run: | | |
cd kcov/build | |
sudo make install | |
- name: Test | |
timeout-minutes: 1 | |
run: make test | |
- name: Upload coverage result to codecov | |
run: bash <(curl -s https://codecov.io/bash) | |
- name: Upload coverage result to codacy | |
run: | | |
export CODACY_PROJECT_TOKEN=${{ secrets.CODACY_PROJECT_TOKEN }} | |
bash <(curl -Ls https://coverage.codacy.com/get.sh) |