Skip to content

Commit

Permalink
Set codecov patch status checks to informational (#381)
Browse files Browse the repository at this point in the history
* This _should_ make the status check not show up as a fail anymore in
PRs.
* Added
[CODEOWNERS](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners)
file, for instance to be used in rulesets.
  • Loading branch information
marijnvanderhorst authored Nov 29, 2024
1 parent 1081438 commit 7e95599
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 15 deletions.
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @esac-ic/code-owners
23 changes: 23 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
version: 2
updates:
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
groups:
prod-dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
day: "sunday"
time: "16:00"
ignore:
- dependency-name: "*"
update-types: [ "version-update:semver-major" ]
33 changes: 22 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ env:
DB_DATABASE: esac
DB_USERNAME: mysql
DB_PASSWORD: mysql
HAS_CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN != '' }}

jobs:
laravel-tests:
tests:
name: Build front-end & run tests
runs-on: ubuntu-latest
environment: Build
steps:
Expand All @@ -35,12 +37,6 @@ jobs:
restore-keys: |
${{ runner.os }}-node-
- name: Docker Login
uses: docker/login-action@v3
with:
username: esacci
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
Expand Down Expand Up @@ -85,22 +81,37 @@ jobs:
- name: Execute tests (Unit and Feature tests) via PHPUnit
run: vendor/bin/phpunit -c phpunit.xml --coverage-clover=coverage.xml

- name: Upload to codecov
- name: Upload to Codecov
uses: codecov/codecov-action@v3
if: env.HAS_CODECOV_TOKEN
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
fail_ci_if_error: true

- name: Build and push Docker images
uses: docker/build-push-action@v5
publish:
name: Build and push Docker image
runs-on: ubuntu-latest
environment: Build
needs: tests
if: github.secret_source == 'Actions' || github.secret_source == 'Dependabot'
steps:
- name: Docker Login
uses: docker/login-action@v3
with:
username: esacci
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
push: true
tags: esac/website:${{ github.run_number }}

deploy:
name: Deploy to production
runs-on: ubuntu-latest
needs: laravel-tests
needs: publish
if: github.event_name == 'push' && github.ref == 'refs/heads/master'
steps:
- name: Deploy via SSH
Expand Down
7 changes: 3 additions & 4 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
coverage:
status:
project: # Applies to the entire project
project: # Applies to the entire project
default:
target: auto
threshold: 25% # Allows coverage to drop by up to 30% without failing

patch: # Applies only to the changes in the pull request
patch: # Applies to the contents of a single PR or commit only.
default:
target: auto
threshold: 25% # Allows coverage to drop by up to 30% without failing
informational: true

0 comments on commit 7e95599

Please sign in to comment.