Skip to content

Minor changes

Minor changes #3100

Workflow file for this run

---
# SPDX-FileCopyrightText: (c) 2021 ale5000
# SPDX-License-Identifier: GPL-3.0-or-later
name: "Base"
permissions: {}
on:
push:
pull_request:
workflow_dispatch:
jobs:
base-job:
name: "Coverage and testing"
runs-on: ubuntu-latest
steps:
- name: "Checkout sources"
uses: actions/checkout@v4
- name: "Setup Java"
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "17"
- name: "Setup Ruby"
uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4"
- name: "Install Bashcov and simplecov-lcov"
run: |
# Installing Bashcov and simplecov-lcov...
gem install bashcov:3.1.3 simplecov-lcov
- name: "Build (with coverage)"
id: "build"
shell: bash
run: |
# Executing code coverage...
export BUILD_TYPE=oss
#sudo apt-get -qq -y install moreutils 1>/dev/null
bashcov '${{ github.workspace }}/build.sh' # To timestamp the output pipe it to: TZ=UTC ts '[%H:%M:%S]'
- name: "Testing (with coverage)"
if: "${{ steps.build.outputs.ZIP_BUILD_TYPE_SUPPORTED == 'true' }}"
shell: bash
run: |
# Testing of zip installation...
echo '==========================='
echo 'TESTING OF ZIP INSTALLATION'
echo '==========================='
bashcov '${{ github.workspace }}/recovery-simulator/recovery.sh' '${{ steps.build.outputs.ZIP_FOLDER }}/${{ steps.build.outputs.ZIP_FILENAME }}'
printf '\n'
echo '==============='
echo 'RECOVERY OUTPUT'
echo '==============='
if test -e '${{ github.workspace }}/recovery-simulator/output/recovery-output.log'; then
cat '${{ github.workspace }}/recovery-simulator/output/recovery-output.log'
fi
printf '\n'
echo '==============='
echo 'INSTALLED FILES'
echo '==============='
if test -e '${{ github.workspace }}/recovery-simulator/output/installed-files.log'; then
cat '${{ github.workspace }}/recovery-simulator/output/installed-files.log'
fi
- name: "Upload coverage reports to Codecov"
if: "${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.repository_owner == 'micro5k' }}"
uses: codecov/codecov-action@v5
with:
fail_ci_if_error: true
token: "${{ secrets.CODECOV_TOKEN }}"
- name: "Upload coverage reports to Codacy"
if: "${{ github.ref == 'refs/heads/main' && github.event_name != 'pull_request' && github.repository_owner == 'micro5k' }}"
uses: codacy/codacy-coverage-reporter-action@v1
with:
project-token: "${{ secrets.CODACY_PROJECT_TOKEN }}"