Skip to content

Commit

Permalink
Rewrite buildkite jobs for GitHub Action (#1746)
Browse files Browse the repository at this point in the history
* Delete flake.lock in docs to better catch issues in tests

* Fix #1757: test nix flake init --template "template#haskell-nix"

* Rewrite `buildkite` jobs for GitHub Action
  • Loading branch information
yvan-sraka committed Dec 2, 2022
1 parent b90fbaa commit 8773809
Show file tree
Hide file tree
Showing 7 changed files with 505 additions and 520 deletions.
16 changes: 0 additions & 16 deletions .github/workflows/autotag.yml

This file was deleted.

408 changes: 408 additions & 0 deletions .github/workflows/pipeline.yml

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions .github/workflows/updates.yml
@@ -0,0 +1,36 @@
name: "Update pins, hackage.nix and stackage.nix"

on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: "0 0 * * *"

jobs:
update-hackage-and-stackage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "Update hackage.nix and stackage.nix"
run: |
nix-build build.nix -A maintainer-scripts.update-hackage -o update-hackage.sh
echo "+++ Updating hackage.nix"
./update-hackage.sh
nix-build build.nix -A maintainer-scripts.update-stackage -o update-stackage.sh
echo "+++ Updating stackage.nix"
./update-stackage.sh
update-pins:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: cachix/install-nix-action@v15
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: "Update pins"
run: |
'buildkite-agent artifact download "flake.lock" .'
nix-build build.nix -A maintainer-scripts.update-pins -o update-pins.sh
./update-pins.sh
76 changes: 34 additions & 42 deletions .github/workflows/windows-secp256k1.yml
Expand Up @@ -3,49 +3,41 @@ on: workflow_dispatch
jobs:
tests:
runs-on: windows-latest

defaults:
run:
shell: bash

steps:

- uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: 8.10.7
cabal-version: 3.6.2.0

- name: Install pkgconfiglite
run: choco install -y pkgconfiglite

- name: Install libsecp256k1
run: |
curl -Ls \
--connect-timeout 5 \
--max-time 10 \
--retry 5 \
--retry-delay 0 \
--retry-max-time 40 \
https://hydra.iohk.io/job/Cardano/haskell-nix/windows-secp256k1/latest/download/1 -o secp256k1.zip
mkdir secp256k1
cd secp256k1
unzip ../secp256k1.zip
cd ..
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH;$(readlink -f secp256k1/lib/pkgconfig | sed 's|^/d|D:|g' | tr / '\\')"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
export SECP256K1_PATH="$(readlink -f secp256k1/bin | sed 's|^/d|D:|g' | tr / '\\')"
echo "SECP256K1_PATH=$SECP256K1_PATH"
echo "$SECP256K1_PATH" >> $GITHUB_PATH
- name: Cabal update
run: cabal update

- name: Build and run haskell-secp256k1 tests
run: |
cabal unpack secp256k1-haskell
cd secp256k1-haskell-*
cabal build --enable-tests
cabal test
- uses: haskell/actions/setup@v1
id: setup-haskell
with:
ghc-version: 8.10.7
cabal-version: 3.6.2.0
- name: Install pkgconfiglite
run: choco install -y pkgconfiglite
- name: Install libsecp256k1
run: |
curl -Ls \
--connect-timeout 5 \
--max-time 10 \
--retry 5 \
--retry-delay 0 \
--retry-max-time 40 \
https://hydra.iohk.io/job/Cardano/haskell-nix/windows-secp256k1/latest/download/1 -o secp256k1.zip
mkdir secp256k1
cd secp256k1
unzip ../secp256k1.zip
cd ..
export PKG_CONFIG_PATH="$PKG_CONFIG_PATH;$(readlink -f secp256k1/lib/pkgconfig | sed 's|^/d|D:|g' | tr / '\\')"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH"
echo "PKG_CONFIG_PATH=$PKG_CONFIG_PATH" >> $GITHUB_ENV
export SECP256K1_PATH="$(readlink -f secp256k1/bin | sed 's|^/d|D:|g' | tr / '\\')"
echo "SECP256K1_PATH=$SECP256K1_PATH"
echo "$SECP256K1_PATH" >> $GITHUB_PATH
- name: Cabal update
run: cabal update
- name: Build and run haskell-secp256k1 tests
run: |
cabal unpack secp256k1-haskell
cd secp256k1-haskell-*
cabal build --enable-tests
cabal test

0 comments on commit 8773809

Please sign in to comment.