Skip to content

Commit

Permalink
ci: Only run PR workflows when files have changed
Browse files Browse the repository at this point in the history
  • Loading branch information
wolfgangwalther committed Feb 21, 2024
1 parent cfc7f7f commit 4c61706
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 7 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,23 @@ on:
secrets:
CACHIX_AUTH_TOKEN:
required: false
pull_request:
branches:
- main
- v[0-9]+
paths:
- .github/workflows/build.yaml
- .github/actions/setup-nix/**
- .github/scripts/**
- .github/*
- '*.nix'
- nix/**
- .cirrus.yml
- cabal.project*
- postgrest.cabal
- stack.yaml*
- '**.hs'
- '!**.md'

concurrency:
# Terminate all previous runs of the same workflow for pull requests
Expand Down
7 changes: 0 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@ on:
- v[0-9]+
tags:
- v*
pull_request:
branches:
- main
- v[0-9]+

concurrency:
# Terminate all previous runs of the same workflow for pull requests
Expand All @@ -20,13 +16,11 @@ concurrency:
jobs:
docs:
name: Docs
if: github.event_name == 'push'
uses: ./.github/workflows/docs.yaml


test:
name: Test
if: github.event_name == 'push'
uses: ./.github/workflows/test.yaml
secrets:
CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }}
Expand All @@ -41,7 +35,6 @@ jobs:

Build-Cabal-Arm:
name: Build aarch64 (Cabal, GHC 9.4.8)
if: github.event_name == 'push'
runs-on: ubuntu-latest
outputs:
remotepath: ${{ steps.Remote-Dir.outputs.remotepath }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,17 @@ name: Docs

on:
workflow_call:
pull_request:
branches:
- main
- v[0-9]+
paths:
- .github/workflows/docs.yaml
- .github/actions/setup-nix/**
- default.nix
- nix/**
- docs/**
- '!**.md'

concurrency:
# Terminate all previous runs of the same workflow for pull requests
Expand Down
15 changes: 15 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ on:
secrets:
CACHIX_AUTH_TOKEN:
required: false
pull_request:
branches:
- main
- v[0-9]+
paths:
- .github/workflows/test.yaml
- .github/actions/setup-nix/**
- default.nix
- nix/**
- .stylish-haskell.yaml
- cabal.project
- postgrest.cabal
- '**.hs'
- test/**
- '!**.md'

concurrency:
# Terminate all previous runs of the same workflow for pull requests
Expand Down

0 comments on commit 4c61706

Please sign in to comment.