Minor changes #2922
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
--- | |
# SPDX-FileCopyrightText: (c) 2021 ale5000 | |
# SPDX-License-Identifier: GPL-3.0-or-later | |
# SPDX-FileType: SOURCE | |
name: "Base" | |
permissions: {} | |
on: | |
push: | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
base-job: | |
name: "Coverage and testing" | |
runs-on: ubuntu-latest | |
steps: | |
- name: "Check out code" | |
uses: actions/checkout@v4 | |
- name: "Set up Java" | |
uses: actions/setup-java@v4 | |
with: | |
distribution: "temurin" | |
java-version: "17" | |
- name: "Set up Ruby" | |
uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: "3.3" | |
- name: "Install Bashcov and simplecov-lcov" | |
run: | | |
# Installing Bashcov and simplecov-lcov... | |
gem install bashcov:3.1.3 simplecov-lcov | |
- name: "Execute code coverage" | |
id: "coverage" | |
run: | | |
### Executing code coverage... | |
workspace_path='${{ github.workspace }}'; readonly workspace_path | |
export BUILD_TYPE=oss | |
#sudo apt-get -qq -y install moreutils 1>/dev/null | |
bashcov "${workspace_path:?}/build.sh" # To timestamp the output pipe it to: TZ=UTC ts '[%H:%M:%S]' | |
printf '\n' | |
### Testing of zip installation... | |
echo '===========================' | |
echo 'TESTING OF ZIP INSTALLATION' | |
echo '===========================' | |
bashcov "${workspace_path:?}/recovery-simulator/recovery.sh" "${workspace_path:?}"/output/*.zip | |
printf '\n' | |
echo '===============' | |
echo 'RECOVERY OUTPUT' | |
echo '===============' | |
if test -e "${workspace_path:?}/recovery-simulator/output/recovery-output.log"; then | |
cat "${workspace_path:?}/recovery-simulator/output/recovery-output.log" | |
fi | |
printf '\n' | |
echo '===============' | |
echo 'INSTALLED FILES' | |
echo '===============' | |
if test -e "${workspace_path:?}/recovery-simulator/output/installed-files.log"; then | |
cat "${workspace_path:?}/recovery-simulator/output/installed-files.log" | |
fi | |
- name: "SHA256" | |
if: "${{ github.event_name != 'pull_request' }}" | |
run: | | |
# SHA256... | |
sha256_hash='${{ steps.coverage.outputs.sha256_hash }}'; readonly sha256_hash | |
echo "::notice::${sha256_hash:-Missing hash}" | |
- name: "Upload artifacts" | |
if: "${{ github.event_name != 'pull_request' }}" | |
uses: actions/upload-artifact@v4 | |
with: | |
name: "microG unofficial installer OSS build (extract it)" | |
path: "output/*.zip*" | |
retention-days: 7 | |
- 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 }} | |
- 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 }}" |