From 7601964e384e6bfd56cb17103fb6e82c134f15bf Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 10:29:28 +0100 Subject: [PATCH 1/8] simple github workflow for cypari2 --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++++++++ .travis-install-pari.sh | 14 ++++++++++++- 2 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..fbee310b --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,41 @@ +name: cypari2 + +on: + pull_request: + types: [opened, synchronize] + push: + tags: + - '*' + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest] + python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + pari-version: ['pari-2.9.4', 'pari-2.9.5', 'pari-2.11.0', 'pari-2.11.0', 'pari-2.11.2', 'pari-2.11.3', 'pari-2.11.4', 'pari-2.13.0', 'snapshot'] + steps: + - env: + LC_ALL: C + PATH: "/usr/lib/ccache:$PATH" + PARI_VERSION: ${{ matrix.pari-version }} + - name: Set up the repository + uses: actions/checkout@v2 + with: + submodules: recursive + fetch-depth: 0 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install pari + run: | + ccache -M 256M && ccache -s + bash -x .travis-install-pari.sh + - name: Local build + run: | + make check + pip install sphinx + (cd docs && make html) diff --git a/.travis-install-pari.sh b/.travis-install-pari.sh index 21000388..328b4be1 100644 --- a/.travis-install-pari.sh +++ b/.travis-install-pari.sh @@ -3,7 +3,19 @@ # Exit on error set -e +if [ "$PARI_VERSION" = snapshot ]; then + URLDIR=snapshots +fi + +if [ "$URLDIR" = "" ]; then + PURE_VERSION=${PARI_VERSION/pari-} + URLDIR=OLD/${PURE_VERSION%.*} +fi + PARI_URL="http://pari.math.u-bordeaux.fr/pub/pari/$URLDIR" +PARI_URL1="http://pari.math.u-bordeaux.fr/pub/pari/unix" +PARI_URL2="http://pari.math.u-bordeaux.fr/pub/pari/unstable" +PARI_URL3="http://pari.math.u-bordeaux.fr/pub/pari/snapshot" # Figure out PARI version and download location # Note that we support giving a list of URLs @@ -14,7 +26,7 @@ if [ "$PARI_VERSION" = snapshot ]; then fi # Download PARI sources -wget --no-verbose "$PARI_URL/$PARI_VERSION.tar.gz" +wget --no-verbose "$PARI_URL/$PARI_VERSION.tar.gz" || wget --no-verbose "$PARI_URL1/$PARI_VERSION.tar.gz" || wget --no-verbose "$PARI_URL2/$PARI_VERSION.tar.gz" || wget --no-verbose "$PARI_URL3/$PARI_VERSION.tar.gz" # Install tar xzf "$PARI_VERSION.tar.gz" From cd37866ac0b17bbf111bd266e898f26605dca113 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 10:31:12 +0100 Subject: [PATCH 2/8] fix syntax --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fbee310b..04b45ab3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,11 +16,11 @@ jobs: os: [ubuntu-latest] python-version: [3.6, 3.7, 3.8, 3.9, 3.10] pari-version: ['pari-2.9.4', 'pari-2.9.5', 'pari-2.11.0', 'pari-2.11.0', 'pari-2.11.2', 'pari-2.11.3', 'pari-2.11.4', 'pari-2.13.0', 'snapshot'] + env: + LC_ALL: C + PATH: "/usr/lib/ccache:$PATH" + PARI_VERSION: ${{ matrix.pari-version }} steps: - - env: - LC_ALL: C - PATH: "/usr/lib/ccache:$PATH" - PARI_VERSION: ${{ matrix.pari-version }} - name: Set up the repository uses: actions/checkout@v2 with: From 5be2b5755a89f56ced1a96b42ee90b4ab42dac86 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 10:33:24 +0100 Subject: [PATCH 3/8] remove submodules --- .github/workflows/main.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 04b45ab3..68af413e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,9 +23,6 @@ jobs: steps: - name: Set up the repository uses: actions/checkout@v2 - with: - submodules: recursive - fetch-depth: 0 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v2 with: From 704d036f656d2ef31411a414b5142dd002529467 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 10:35:44 +0100 Subject: [PATCH 4/8] export path later --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68af413e..d7979b68 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,7 +18,6 @@ jobs: pari-version: ['pari-2.9.4', 'pari-2.9.5', 'pari-2.11.0', 'pari-2.11.0', 'pari-2.11.2', 'pari-2.11.3', 'pari-2.11.4', 'pari-2.13.0', 'snapshot'] env: LC_ALL: C - PATH: "/usr/lib/ccache:$PATH" PARI_VERSION: ${{ matrix.pari-version }} steps: - name: Set up the repository @@ -30,6 +29,7 @@ jobs: - name: Install pari run: | ccache -M 256M && ccache -s + export PATH="/usr/lib/ccache:$PATH" bash -x .travis-install-pari.sh - name: Local build run: | From 60cc9e0600edd1855eff8051f31fb6555ee144f2 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 10:36:48 +0100 Subject: [PATCH 5/8] fix syntax for python3.10 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7979b68..b26cbc4d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,7 +14,7 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - python-version: [3.6, 3.7, 3.8, 3.9, 3.10] + python-version: ['3.6', '3.7', '3.8', '3.9', '3.10'] pari-version: ['pari-2.9.4', 'pari-2.9.5', 'pari-2.11.0', 'pari-2.11.0', 'pari-2.11.2', 'pari-2.11.3', 'pari-2.11.4', 'pari-2.13.0', 'snapshot'] env: LC_ALL: C From f5be321d373d94fc3fd1c9744688ba89c7be81e4 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 11:49:32 +0100 Subject: [PATCH 6/8] make build; install; check --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index b26cbc4d..dbc0c8da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,6 +33,8 @@ jobs: bash -x .travis-install-pari.sh - name: Local build run: | + make build + make install make check pip install sphinx (cd docs && make html) From 01f37a9895384bd78c3c76912f690c633d096f9c Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 12:27:33 +0100 Subject: [PATCH 7/8] requirements --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index dbc0c8da..2b3d1a97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -33,8 +33,8 @@ jobs: bash -x .travis-install-pari.sh - name: Local build run: | + pip install sphinx cython cysignals make build make install make check - pip install sphinx (cd docs && make html) From 0bf0a678c6f0f0c865f89a43da1b3f84922cfdc7 Mon Sep 17 00:00:00 2001 From: Jonathan Kliem Date: Mon, 22 Nov 2021 12:56:34 +0100 Subject: [PATCH 8/8] allow to run manually --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2b3d1a97..fffbd4f2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,6 +6,8 @@ on: push: tags: - '*' + workflow_dispatch: + # Allow to run manually jobs: build: