Skip to content

Commit

Permalink
cache build steps
Browse files Browse the repository at this point in the history
  • Loading branch information
prolic committed Nov 14, 2024
1 parent b4426ef commit f10fa0a
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 18 deletions.
43 changes: 36 additions & 7 deletions .github/workflows/continuous.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,60 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: '9.6.6'
cabal-version: '3.10.3.0'

- name: Cache Cabal packages
- name: Cache Haskell Build
uses: actions/cache@v4
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
~/.ghc
~/.stack
key: ${{ runner.os }}-ghc-9.6.6-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-ghc-9.6.6-cabal-
- name: Set up Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: '9.6.6'
cabal-version: '3.10.3.0'

- name: Update Cabal package list
run: |
cabal update
- name: Cache Dependencies
uses: actions/cache@v4
id: deps-cache
with:
path: |
/usr/local/lib/libsecp256k1*
/usr/local/include/secp256k1*
key: ${{ runner.os }}-deps-secp256k1-v0.5.1

- name: Install Build Tools
run: |
sudo apt-get update
sudo apt-get install -y autoconf autogen automake libtool
- name: Cache Qt5 Dependencies
uses: actions/cache@v4
id: qt5-cache
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: ${{ runner.os }}-qt5-deps-${{ hashFiles('.github/workflows/release.yml') }}

- name: Install Qt5 Dependencies
if: steps.qt5-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y qtdeclarative5-dev libqt5quick5 qt5-image-formats-plugins qttools5-dev-tools qtbase5-dev
- name: Install secp256k1 Library
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
Expand All @@ -56,6 +79,12 @@ jobs:
sudo make install && \
cd ..
- name: Restore secp256k1 from cache
if: steps.deps-cache.outputs.cache-hit == 'true'
run: |
sudo cp -r /usr/local/lib/libsecp256k1* /usr/local/lib/
sudo cp -r /usr/local/include/secp256k1* /usr/local/include/
- name: Set Library Path
run: |
echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf && sudo ldconfig
Expand Down
48 changes: 37 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,37 +18,57 @@ jobs:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Set up Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: '9.6.6'
cabal-version: '3.10.3.0'

- name: Cache Cabal packages
- name: Cache Haskell Build
uses: actions/cache@v4
with:
path: |
~/.cabal/packages
~/.cabal/store
dist-newstyle
~/.ghc
~/.stack
key: ${{ runner.os }}-ghc-9.6.6-cabal-${{ hashFiles('**/*.cabal', '**/cabal.project', '**/cabal.project.freeze') }}
restore-keys: |
${{ runner.os }}-ghc-9.6.6-cabal-
- name: Set up Haskell
uses: haskell/actions/setup@v1
with:
ghc-version: '9.6.6'
cabal-version: '3.10.3.0'
enable-stack: false
stack-no-global: true

- name: Update Cabal package list
run: |
cabal update
- name: Install Build Tools
run: |
sudo apt-get update
sudo apt-get install -y autoconf autogen automake libtool
- name: Cache Dependencies
uses: actions/cache@v4
id: deps-cache
with:
path: |
/usr/local/lib/libsecp256k1*
/usr/local/include/secp256k1*
key: ${{ runner.os }}-deps-secp256k1-v0.5.1

- name: Cache Qt5 Dependencies
uses: actions/cache@v4
id: qt5-cache
with:
path: |
/var/cache/apt/archives
/var/lib/apt/lists
key: ${{ runner.os }}-qt5-deps-${{ hashFiles('.github/workflows/release.yml') }}

- name: Install Qt5 Dependencies
if: steps.qt5-cache.outputs.cache-hit != 'true'
run: |
sudo apt-get update
sudo apt-get install -y qtdeclarative5-dev libqt5quick5 qt5-image-formats-plugins qttools5-dev-tools qtbase5-dev
- name: Install secp256k1 Library
if: steps.deps-cache.outputs.cache-hit != 'true'
run: |
git clone https://github.com/bitcoin-core/secp256k1 && \
cd secp256k1 && \
Expand All @@ -59,6 +79,12 @@ jobs:
sudo make install && \
cd ..
- name: Restore secp256k1 from cache
if: steps.deps-cache.outputs.cache-hit == 'true'
run: |
sudo cp -r /usr/local/lib/libsecp256k1* /usr/local/lib/
sudo cp -r /usr/local/include/secp256k1* /usr/local/include/
- name: Set Library Path
run: |
echo "/usr/local/lib" | sudo tee /etc/ld.so.conf.d/local.conf && sudo ldconfig
Expand Down

0 comments on commit f10fa0a

Please sign in to comment.