Fixed PCOV not reporting coverage. #423
Workflow file for this run
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 Scaffold | |
# Workflow to **validate** the **integrity** of the scaffold template itself. | |
on: | |
push: | |
branches: | |
- 1.x | |
pull_request: | |
branches: | |
- 1.x | |
- 'feature/**' | |
jobs: | |
scaffold-test-devtools: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
bats-tags: ['p0', 'p1', 'p2'] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Upgrade sqlite3 | |
run: | | |
wget https://www.sqlite.org/2024/sqlite-autoconf-3450300.tar.gz -O /tmp/sqlite.tar.gz | |
tar -xzf /tmp/sqlite.tar.gz -C /tmp | |
cd /tmp/sqlite-autoconf-3450300 | |
./configure CFLAGS="-DSQLITE_ENABLE_COLUMN_METADATA=1" --prefix=/usr/local | |
make && sudo make install | |
sudo ldconfig | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 8.3 | |
extensions: gd, sqlite, pdo_sqlite | |
- name: Check coding standards | |
uses: luizm/[email protected] | |
env: | |
SHFMT_OPTS: -i 2 -ci -s -d | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
- name: Setup kcov | |
run: wget https://github.com/SimonKagstrom/kcov/releases/download/v42/kcov-amd64.tar.gz && tar -xf kcov-amd64.tar.gz && sudo mv ./usr/local/bin/kcov /usr/local/bin/kcov && kcov --version | |
- name: Install Ahoy | |
run: | | |
os=$(uname -s | tr '[:upper:]' '[:lower:]') && architecture=$(case $(uname -m) in x86_64 | amd64) echo "amd64" ;; aarch64 | arm64 | armv8) echo "arm64" ;; *) echo "amd64" ;; esac) | |
sudo wget -q https://github.com/ahoy-cli/ahoy/releases/download/v2.1.1/ahoy-bin-"${os}-${architecture}" -O /usr/local/bin/ahoy | |
sudo chown "$USER" /usr/local/bin/ahoy && chmod +x /usr/local/bin/ahoy | |
- name: Install dependencies | |
run: npm ci | |
working-directory: .scaffold/tests | |
- name: Run tests | |
run: | | |
kcov \ | |
--include-pattern=.sh,.bash \ | |
--bash-parse-files-in-dir=. \ | |
--exclude-pattern=vendor,node_modules,.scaffold-coverage-html,.scaffold \ | |
"$(pwd)"/.scaffold-coverage-html \ | |
.scaffold/tests/node_modules/.bin/bats \ | |
.scaffold/tests/bats --filter-tags "${{ matrix.bats-tags }}" | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Upload coverage report as an artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{github.job}}-code-coverage-report-${{ matrix.bats-tags }} | |
path: ./.scaffold-coverage-html | |
include-hidden-files: true | |
if-no-files-found: error | |
- name: Upload coverage report to Codecov | |
uses: codecov/codecov-action@v5 | |
if: ${{ env.CODECOV_TOKEN != '' }} | |
with: | |
directory: ./.scaffold-coverage-html | |
fail_ci_if_error: true | |
token: ${{ secrets.CODECOV_TOKEN }} | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | |
scaffold-test-actions: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Check coding standards with yamllint | |
run: yamllint --config-file .scaffold/tests/.yamllint-for-gha.yml .github/workflows | |
continue-on-error: ${{ vars.DREVOPS_CI_YAMLLINT_IGNORE_FAILURE == '1' }} | |
- name: Check coding standards with actionlint | |
run: docker run --rm -v "${GITHUB_WORKSPACE:-.}":/app --workdir /app rhysd/actionlint:1.6.27 -ignore 'SC2002:' -ignore 'SC2155:' | |
continue-on-error: ${{ vars.DREVOPS_CI_ACTIONLINT_IGNORE_FAILURE == '1' }} |