Compare commits

..

2 commits

Author SHA1 Message Date
718d1404f4
Merge e06c0100c8 into a54a8f2057 2024-11-19 16:35:17 +00:00
Alexis Métaireau
e06c0100c8
CI: Only run the CI on pull requests, and on the "main" branch
Previously, the actions were duplicated, due to the fact when developing
we often create feature branches and open pull requests.

This new setup requires us to open pull requests to trigger the CI.
2024-11-19 17:33:32 +01:00
2 changed files with 6 additions and 34 deletions

View file

@ -1,6 +1,10 @@
name: Build dev environments
on:
pull_request:
push:
branches:
- main
- "test/**"
schedule:
- cron: "0 0 * * *" # Run every day at 00:00 UTC.

View file

@ -1,9 +1,10 @@
name: Tests
on:
pull_request:
push:
branches:
- main
pull_request:
- "test/**"
schedule:
- cron: "2 0 * * *" # Run every day at 02:00 UTC.
workflow_dispatch:
@ -25,24 +26,7 @@ concurrency:
cancel-in-progress: true
jobs:
should-run:
runs-on: ubuntu-latest
outputs:
run-workflow: ${{ steps.check.outputs.run-workflow }}
steps:
- id: check
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
echo "run-workflow=true" >> $GITHUB_OUTPUT
elif [[ "${{ github.event_name }}" == "push" && "${{ github.ref }}" != "refs/heads/main" ]]; then
echo "run-workflow=true" >> $GITHUB_OUTPUT
else
echo "run-workflow=false" >> $GITHUB_OUTPUT
fi
run-lint:
needs: should-run
if: needs.should-run.outputs.run-workflow == 'true'
runs-on: ubuntu-latest
container:
image: debian:bookworm
@ -61,8 +45,6 @@ jobs:
# This is already built daily by the "build.yml" file
# But we also want to include this in the checks that run on each push.
build-container-image:
needs: should-run
if: needs.should-run.outputs.run-workflow == 'true'
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
@ -87,8 +69,6 @@ jobs:
python3 ./install/common/build-image.py
download-tessdata:
needs: should-run
if: needs.should-run.outputs.run-workflow == 'true'
name: Download and cache Tesseract data
runs-on: ubuntu-latest
steps:
@ -115,8 +95,6 @@ jobs:
runs-on: windows-latest
needs:
- download-tessdata
- should-run
if: needs.should-run.outputs.run-workflow == 'true'
env:
DUMMY_CONVERSION: 1
steps:
@ -148,8 +126,6 @@ jobs:
runs-on: ${{ matrix.runner }}
needs:
- download-tessdata
- should-run
if: needs.should-run.outputs.run-workflow == 'true'
strategy:
matrix:
include:
@ -178,9 +154,7 @@ jobs:
build-deb:
needs:
- should-run
- build-container-image
if: needs.should-run.outputs.run-workflow == 'true'
name: "build-deb (${{ matrix.distro }} ${{ matrix.version }})"
runs-on: ubuntu-latest
strategy:
@ -252,8 +226,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-deb
- should-run
if: needs.should-run.outputs.run-workflow == 'true'
strategy:
matrix:
include:
@ -309,8 +281,6 @@ jobs:
runs-on: ubuntu-latest
needs:
- build-container-image
- should-run
if: needs.should-run.outputs.run-workflow == 'true'
strategy:
matrix:
distro: ["fedora"]
@ -376,8 +346,6 @@ jobs:
needs:
- build-container-image
- download-tessdata
- should-run
if: needs.should-run.outputs.run-workflow == 'true'
strategy:
matrix:
include: