diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..9cd602b --- /dev/null +++ b/.github/workflows/build.yml @@ -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 diff --git a/cabal-extract/Main.hs b/cabal-extract/Main.hs index 36cbfb5..6d9a716 100644 --- a/cabal-extract/Main.hs +++ b/cabal-extract/Main.hs @@ -34,7 +34,6 @@ import System.Directory getCurrentDirectory, listDirectory, ) -import System.Environment (getArgs) import System.FilePath ( takeExtension, takeFileName, @@ -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