Skip to content

Commit

Permalink
Merge pull request #1 from ManasJayanth/ci-use-esy-package
Browse files Browse the repository at this point in the history
CI: Use esy-package command
  • Loading branch information
ManasJayanth authored May 25, 2024
2 parents d8f8c82 + 45963af commit ab63f0d
Show file tree
Hide file tree
Showing 11 changed files with 85 additions and 448 deletions.
54 changes: 0 additions & 54 deletions .ci/steps.sh

This file was deleted.

87 changes: 0 additions & 87 deletions .ci/verdaccio-config.yaml

This file was deleted.

8 changes: 0 additions & 8 deletions .ci/yarnrc

This file was deleted.

2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.sh text=auto eol=lf

75 changes: 38 additions & 37 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
name: Build and test the esy package

on:
- push

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-latest
- ubuntu-latest
# - windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Use Node.js 14.x
uses: actions/setup-node@v1
with:
node-version: 14.x

- name: Install esy
run: npm install -g @esy-nightly/esy verdaccio

- name: Run end-to-end tests on the package
run: bash ./.ci/steps.sh
shell: bash

- uses: actions/upload-artifact@v2
with:
name: release
path: package.tar.gz
name: Build and test the esy package

on:
- push

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- macos-13
- macos-latest
- ubuntu-latest
- windows-latest

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3

- name: Install esy, verdaccio and esy-package
run: npm install -g esy verdaccio esy-package@latest # to be reverted to dev

- name: Run end-to-end tests on the package
run: DEBUG=bale*,verdaccio* esy-package
shell: bash
env:
SHELL: "bash.exe" # HACK!! For some weird reason, $SHELL in Github actions' Windows' bash shell doesn't set this environment variable. We rely on it to figure if path normalisation is necessary on Gitbash Windows

- uses: actions/upload-artifact@v3
with:
name: release
path: package.tar.gz
1 change: 0 additions & 1 deletion .npmrc

This file was deleted.

12 changes: 6 additions & 6 deletions esy-test/package.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"esy": {
"build": "pkg-config --libs gmp"
"buildsInSource": true,
"build": [
"#{os == 'windows' ? 'x86_64-w64-mingw32-':''}gcc test.c -I#{esy-gmp.install / 'include'} -L#{esy-gmp.lib} -lgmp -o test",
"./test"
]
},
"dependencies": {
"yarn-pkg-config": "*",
"esy-gmp": "6.2.1000"
},
"resolutions": {
"yarn-pkg-config": "esy-ocaml/yarn-pkg-config#9293b15f9f0e3dcac6f86ebb1e09a2fa766289ba"
"esy-gmp": "6.3.0"
}
}
12 changes: 12 additions & 0 deletions esy-test/test.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <gmp.h>
#include <stdlib.h>

int main() {
mpz_t i, j, k;
mpz_init_set_str (i, "1a", 16);
mpz_init (j);
mpz_init (k);
mpz_sqrtrem (j, k, i);
if (mpz_get_si (j) != 5 || mpz_get_si (k) != 1) abort();
return 0;
}
28 changes: 24 additions & 4 deletions esy.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,36 @@
{
"name": "esy-gmp",
"version": "6.2.1000",
"version": "6.3.0",
"description": "GMP packaged for esy",
"source": "https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz#sha256:fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2",
"source": "https://ftp.gnu.org/gnu/gmp/gmp-6.3.0.tar.xz#sha256:a3c2b80201b89e68616f4ad30bc66aee4927c3ce50e33929ca819d5c43538898",
"override": {
"buildEnv": {},
"build": ["sh ./esy-configure.sh", "make"],
"build": ["bash ./esy-configure.sh", "make -j8"],
"install": "make install",
"buildsInSource": true,
"exportedEnv": {
"LDFLAGS": {
"scope": "global",
"val": "-L#{self.lib} -lgmp"
},
"CPPFLAGS": {
"scope": "global",
"val": "-I#{self.install / 'include'}"
},
"LD_LIBRARY_PATH": {
"scope": "global",
"val": "#{self.lib}:$LD_LIBRARY_PATH"
},
"LIBRARY_PATH": {
"scope": "global",
"val": "#{self.lib}:$LIBRARY_PATH"
},
"CPATH": {
"scope": "global",
"val": "#{self.install / 'include'}:$CPATH"
},
"PKG_CONFIG_PATH": {
"val": "#{self.lib / 'pkgconfig'}",
"val": "#{self.lib / 'pkgconfig' : $PKG_CONFIG_PATH}",
"scope": "global"
}
},
Expand Down
14 changes: 3 additions & 11 deletions files/esy-configure.sh
Original file line number Diff line number Diff line change
@@ -1,17 +1,7 @@
#! /bin/sh
#! /bin/bash

CONFIGURE_FLAGS=("--prefix=$cur__install" "--enable-cxx" "--with-pic")

UNAME_M=$(uname -m)

ARCH="${UNAME_M%%*( )}"
OS=$(uname -s)

if [ "$OS" == "Darwin" ]
then
CONFIGURE_FLAGS+=("--build=${ARCH}-apple-darwin$(uname -r)")
fi

case "$(uname -s)" in
CYGWIN*|MINGW32*|MSYS*)
CONFIGURE_FLAGS+=("--host x86_64-w64-mingw32")
Expand All @@ -22,4 +12,6 @@ case "$(uname -s)" in
esac

CONFIGURE_ARGS=$(printf '%s ' "${CONFIGURE_FLAGS[@]}")
export PATH="/usr/x86_64-w64-mingw32/sys-root/mingw/bin:$PATH" # because mingw g++ fails the ./configure tests around certain flags
find ./ -exec touch -t 200905010101 {} + # because, other makeinfo is being looked up, which we'd like to avoid installing
./configure $CONFIGURE_ARGS
Loading

0 comments on commit ab63f0d

Please sign in to comment.