Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Build Matrix

on:
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
jobs:
generate-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v47

- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
15 changes: 5 additions & 10 deletions cabal-extract/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ import System.Directory
getCurrentDirectory,
listDirectory,
)
import System.Environment (getArgs)
import System.FilePath
( takeExtension,
takeFileName,
Expand Down Expand Up @@ -152,15 +151,11 @@ removeExternalDeps = map removeExt
}

main :: IO ()
main = do
args <- getArgs

allCabals <- getCurrentDirectory >>= findCabalFiles >>= extractFlatDepTree
allTargets <- mapM findCabalFiles args >>= extractFlatDepTree . concat

filter (\c -> ciName c `elem` map ciName allTargets) allCabals
& encode
& BL.putStrLn
main =
getCurrentDirectory
>>= findCabalFiles
>>= extractFlatDepTree
>>= BL.putStrLn . encode
where
extractFlatDepTree x =
mapM (readGenericPackageDescription Verbosity.deafening) x
Expand Down