Skip to content

Commit

Permalink
Use Github Action to install libsecp256k1
Browse files Browse the repository at this point in the history
  • Loading branch information
newhoggy committed Dec 28, 2022
1 parent cd0c2f8 commit a010846
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 41 deletions.
25 changes: 15 additions & 10 deletions .github/workflows/github-page.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,24 @@ jobs:
sudo apt-get -y remove --purge software-properties-common
sudo apt-get -y autoremove
- uses: actions/cache@v3
name: "Cache secp256k1"
- name: Install secp256k1
uses: input-output-hk/setup-secp256k1@v1
with:
path: secp256k1
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
git-ref: ${{ env.SECP256K1_REF }}
cache-version: ${{ env.SECP_CACHE_VERSION }}

- name: "Install secp256k1"
- name: Show paths
shell: bash
env:
CI_SECP_FLAGS: "--prefix=/usr/local"
CI_SECP_INSTALL_CMD: sudo
run: bash .github/workflows/build-secp256k1.bash
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
- name: List all pkg-config packages
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
pkg-config --list-all
- name: Cabal update
run: cabal update
Expand Down
46 changes: 15 additions & 31 deletions .github/workflows/haskell.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:

env:
# Modify this value to "invalidate" the cabal cache.
CABAL_CACHE_VERSION: "2022-12-28"
CABAL_CACHE_VERSION: "2022-12-28-a"

# Modify this value to "invalidate" the secp cache.
SECP_CACHE_VERSION: "2022-12-23"
Expand Down Expand Up @@ -155,33 +155,24 @@ jobs:
if: runner.os == 'macOS'
run: brew install autoconf automake libtool

- uses: actions/cache@v3
name: "Cache secp256k1"
- name: Install secp256k1
uses: input-output-hk/setup-secp256k1@v1
with:
path: secp256k1
key: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
restore-keys: cache-secp256k1-${{ runner.os }}-${{ env.SECP_CACHE_VERSION }}
git-ref: ${{ env.SECP256K1_REF }}
cache-version: ${{ env.SECP_CACHE_VERSION }}

- name: "LINUX: Install secp256k1"
if: runner.os != 'Windows'
- name: Show paths
shell: bash
env:
CI_SECP_FLAGS: "--prefix=/usr/local"
CI_SECP_INSTALL_CMD: sudo
run: bash .github/workflows/build-secp256k1.bash
run: |
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
# TODO: this really should come from a pre-built location
- name: "WIN: Install secp256k1"
if: runner.os == 'Windows'
# Same env as tmate action
env:
MSYS2_PATH_TYPE: inherit
MSYSTEM: MINGW64
CHERE_INVOKING: 1
# install secp into /mingw64 prefix, which is where pkg-config will look
# by default.
CI_SECP_FLAGS: "--prefix=/mingw64"
run: C:\\msys64\\usr\\bin\\bash.exe .github/workflows/build-secp256k1.bash
- name: List all pkg-config packages
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
pkg-config --list-all
- name: Cabal update
run: cabal update
Expand All @@ -199,13 +190,6 @@ jobs:
echo "# cabal.project.local"
cat cabal.project.local
- name: List all pkg-config packages
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
# we are very deliberate about only adding msys64 to the path where absolutely necessary.
${{ (runner.os == 'Windows' && '$env:PATH=("C:\msys64\mingw64\bin;{0}" -f $env:PATH)') || '' }}
pkg-config --list-all
- name: Build dry run
run: |
# The tests call out to msys2 commands. We generally do not want to mix toolchains, so
Expand Down

0 comments on commit a010846

Please sign in to comment.