Skip to content

Commit

Permalink
CI: use submodules instead of source repos
Browse files Browse the repository at this point in the history
  • Loading branch information
danmatichuk committed Dec 11, 2023
1 parent 5f7abe3 commit 2b82dbb
Showing 1 changed file with 5 additions and 18 deletions.
23 changes: 5 additions & 18 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,27 +36,14 @@ jobs:

- uses: actions/checkout@v2
with:
submodules: 'true'

# This is necessary to support caching with cabal. If we build directly from
# submodules, cabal will not use the cache for them due to mtime
# differences. Instead, we convert our submodules into cabal's "source
# repositories", which are actually built into the cabal store
# instead. While that shouldn't make a difference, packages in the store are
# only rebuilt based on hashes and not mtimes, which means that they are
# actually reused from the cache.
- name: Convert Submodules to Source Repos
submodules: 'false'

- name: Setup subrepos and cabal.project
run: |
git config --global url."https://github.com/".insteadOf "[email protected]:"
git config --global url."https://".insteadOf "git://"
curl -sL https://github.com/RyanGlScott/submods-to-source-repos/releases/download/0.0.0.20211210/submods-to-source-repos-0.0.0.20211210.xz > submods-to-source-repos.xz
echo 'f339f4bbe43af96df7e8ce115377e56f4861bab5c8f66d3129492cbe7695bbac submods-to-source-repos.xz' | sha256sum -c -
xz -d < submods-to-source-repos.xz > submods-to-source-repos
rm -f submods-to-source-repos.xz
chmod a+x submods-to-source-repos
./submods-to-source-repos cabal.project.dist > cabal.project
echo "Constructed cabal.project:"
cat cabal.project
git submodule update --init
cp cabal.project.dist cabal.project
- name: Installing the freeze file
run: mv cabal.GHC-${{ matrix.ghc }}.freeze cabal.project.freeze
Expand Down

0 comments on commit 2b82dbb

Please sign in to comment.