ci: only runs dependency-review for pull requests #456
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
--- | |
# DO NOT EDIT: this file is automatically synced from the template repository | |
# in https://github.com/Liber-UFPE/project-starter. | |
name: Lighthouse CI | |
# yamllint disable rule:truthy | |
on: | |
push: | |
branches: [ "main" ] | |
pull_request: | |
types: [ "opened", "synchronize", "reopened" ] | |
# yamllint enable rule:truthy | |
env: | |
GRADLE_OPTS: > | |
-Dorg.gradle.console=plain | |
-Dorg.gradle.caching=true | |
-Dsonar.gradle.skipCompile=true | |
-Dorg.gradle.jvmargs="-Xmx2g -XX:MaxMetaspaceSize=512m"' | |
jobs: | |
lighthouse-ci: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- run: corepack enable | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: "lts/*" # latest lts | |
check-latest: true | |
cache: "yarn" | |
- uses: ./.github/gradle-action | |
- run: ./gradlew classes | |
- run: yarn install | |
- name: Run Lighthouse CI | |
run: | | |
npx lhci collect | |
npx lhci assert | |
- name: Upload Lighthouse CI results | |
uses: actions/upload-artifact@v4 | |
if: always() | |
with: | |
name: lighthouse-ci-results-${{ github.run_id }}-${{ github.sha }} | |
path: .lighthouseci/ | |
retention-days: 30 |