Skip to content

Commit

Permalink
Ensure the coverage workflow uses the config from its own branch
Browse files Browse the repository at this point in the history
  • Loading branch information
cedric-anne authored Jun 27, 2024
1 parent aa4ad2c commit 79ae6e2
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 12 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/coverage-schedule.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: "Code coverage schedule"

on:
schedule:
- cron: '0 0 * * *'

jobs:
run-coverage-workflow:
name: "Run coverage workflow"
uses: "glpi-project/glpi/.github/workflows/coverage.yml@main"
with:
branch: "main"
26 changes: 14 additions & 12 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,29 @@
name: "GLPI test code coverage"

on:
# Runs coverage suite when a pull request updates workflow file
pull_request:
paths:
- ".github/workflows/coverage.yml"
# Runs coverage suite every night
schedule:
- cron: '0 0 * * *'
# Enable execution from the "Code coverage schedule" workflow
workflow_call:
inputs:
branch:
required: true
type: string
# Enable manual run
workflow_dispatch:
inputs:
branch:
description: "Target branch"
required: true
type: string

jobs:
coverage:
# Do not run scheduled coverage on tier repositories
if: github.repository == 'glpi-project/glpi' || github.event_name != 'schedule'
name: "Code coverage"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
include:
- {branch: "main", php-version: "8.2", db-image: "mariadb:11.0"}
- {php-version: "8.2", db-image: "mariadb:11.0"}
env:
COMPOSE_FILE: ".github/actions/docker-compose-app.yml:.github/actions/docker-compose-services.yml"
APPLICATION_ROOT: "${{ github.workspace }}"
Expand All @@ -36,7 +38,7 @@ jobs:
- name: "Checkout"
uses: "actions/checkout@v4"
with:
ref: ${{ matrix.branch }}
ref: ${{ inputs.branch }}
- name: "Restore dependencies cache"
uses: actions/cache@v4
with:
Expand Down Expand Up @@ -76,4 +78,4 @@ jobs:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
files: ./tests/coverage-functional/clover.xml,./tests/coverage-ldap/clover.xml,./tests/coverage-imap/clover.xml
override_branch: ${{ matrix.branch }}
override_branch: ${{ inputs.branch }}

0 comments on commit 79ae6e2

Please sign in to comment.