From 39a69602ce50c1217d251d8dac25aa45d09aad52 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 13:19:13 +0100 Subject: [PATCH 01/12] Initial test version --- .github/workflows/build.yml | 40 +++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000000..b31d1b6a886 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,40 @@ +name: Build + +on: + push: + workflow_dispatch: + # Allow to run manually + +jobs: + build: + runs-on: ubuntu-latest + container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:9.5 + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Test + run: + pwd + id -u + id -un + ls -la + + - name: Setup environment + run: | + # Populate SAGE_LOCAL based on the built SAGE_LOCAL contained in the Docker image + ls $HOME + mv $HOME/sage-local local + rm -Rf $HOME/sage-local + ln -sf $(pwd)/local $HOME/sage-local + + - name: Build + run: | + ./bootstrap + ./configure --enable-build-as-root + make build + env: + MAKE: make -j2 + + - name: Test + run: ./sage -t --all From 9a9671784c028388e70b0e676a982401c1ed37d4 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 13:37:44 +0100 Subject: [PATCH 02/12] Find sage --- .github/workflows/build.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b31d1b6a886..a9ed21b1654 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Build +name: Build & Test on: push: @@ -15,10 +15,8 @@ jobs: - name: Test run: - pwd - id -u - id -un ls -la + ls /sage - name: Setup environment run: | From fcbb33a98c9856e88892111a32ca3c1fa5f10384 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 13:43:25 +0100 Subject: [PATCH 03/12] Found sage ? --- .github/workflows/build.yml | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a9ed21b1654..d3f5362d627 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,18 +13,12 @@ jobs: - name: Checkout uses: actions/checkout@v2 - - name: Test - run: - ls -la - ls /sage - - name: Setup environment run: | # Populate SAGE_LOCAL based on the built SAGE_LOCAL contained in the Docker image - ls $HOME - mv $HOME/sage-local local - rm -Rf $HOME/sage-local - ln -sf $(pwd)/local $HOME/sage-local + mv sage/local local + rm -Rf sage/local + ln -sf local sage/local - name: Build run: | From 44a7b58b9aa43b312107049a734282b062033352 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 14:01:47 +0100 Subject: [PATCH 04/12] Fix path --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d3f5362d627..8750cdf16c2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,9 +16,9 @@ jobs: - name: Setup environment run: | # Populate SAGE_LOCAL based on the built SAGE_LOCAL contained in the Docker image - mv sage/local local - rm -Rf sage/local - ln -sf local sage/local + mv /sage/local local + rm -Rf /sage/local + ln -sf local /sage/local - name: Build run: | From 06c3b00a2ad156776ab3210e00ea4aff22b26869 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 17:31:44 +0100 Subject: [PATCH 05/12] Use absolute path for symlink --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8750cdf16c2..c6b73a9b9d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: # Populate SAGE_LOCAL based on the built SAGE_LOCAL contained in the Docker image mv /sage/local local rm -Rf /sage/local - ln -sf local /sage/local + ln -sf "$(pwd)"/local /sage/local - name: Build run: | From a65c19426564ebb3cbaea2f579c4b1fa60d3419c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 17:32:53 +0100 Subject: [PATCH 06/12] Add SAGE_NUM_THREADS for build --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c6b73a9b9d1..da6866c1661 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,6 +27,7 @@ jobs: make build env: MAKE: make -j2 + SAGE_NUM_THREADS: 2 - name: Test run: ./sage -t --all From 1ebe0d10d4d08fbf1a10d8687f03acfa031d49d6 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 17:33:45 +0100 Subject: [PATCH 07/12] Add cancel of previous runs --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index da6866c1661..2a2e0e67018 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,6 +10,11 @@ jobs: runs-on: ubuntu-latest container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:9.5 steps: + - name: Cancel previous runs + uses: styfle/cancel-workflow-action@0.9.1 + with: + access_token: ${{ github.token }} + - name: Checkout uses: actions/checkout@v2 From 676799b3b45f2a85c3ce767d161d5660cde15788 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Mon, 31 Jan 2022 19:50:49 +0100 Subject: [PATCH 08/12] Run tests in parallel --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2a2e0e67018..6cc232f260a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,4 +35,4 @@ jobs: SAGE_NUM_THREADS: 2 - name: Test - run: ./sage -t --all + run: ./sage -t --all -p0 From d27ca7f2e5ae0483a226926aa11e69d6b4417bab Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 1 Feb 2022 14:29:09 +0100 Subject: [PATCH 09/12] Improve based on feedback --- .github/workflows/build.yml | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6cc232f260a..6252af0dad7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,31 +5,27 @@ on: workflow_dispatch: # Allow to run manually +concurrency: + # Cancel previous runs of this workflow for the same branc + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: build: runs-on: ubuntu-latest container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:9.5 steps: - - name: Cancel previous runs - uses: styfle/cancel-workflow-action@0.9.1 - with: - access_token: ${{ github.token }} - - name: Checkout uses: actions/checkout@v2 - - name: Setup environment + - name: Prepare run: | - # Populate SAGE_LOCAL based on the built SAGE_LOCAL contained in the Docker image - mv /sage/local local - rm -Rf /sage/local - ln -sf "$(pwd)"/local /sage/local + # Reuse built SAGE_LOCAL contained in the Docker image + ./bootstrap + ./configure --enable-build-as-root --prefix=/sage/local - name: Build - run: | - ./bootstrap - ./configure --enable-build-as-root - make build + run: make build env: MAKE: make -j2 SAGE_NUM_THREADS: 2 From 4f5bcb9fe895728a5707a6cdaad7a9c5a49e9dab Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 1 Feb 2022 14:30:38 +0100 Subject: [PATCH 10/12] Test that cancel works as desired --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6252af0dad7..29fd79c9f48 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,7 +6,7 @@ on: # Allow to run manually concurrency: - # Cancel previous runs of this workflow for the same branc + # Cancel previous runs of this workflow for the same branch group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true From 3b0e99f648280c6665e10104bd2794a2bdaabfd8 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Tue, 1 Feb 2022 16:50:48 +0100 Subject: [PATCH 11/12] Use --with-sage-venv --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29fd79c9f48..be7c599c16e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,7 @@ jobs: run: | # Reuse built SAGE_LOCAL contained in the Docker image ./bootstrap - ./configure --enable-build-as-root --prefix=/sage/local + ./configure --enable-build-as-root --prefix=/sage/local --with-sage-venv - name: Build run: make build From 63298162ccec5c390018231b036a9dc5dd107e55 Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Thu, 3 Feb 2022 11:53:37 +0100 Subject: [PATCH 12/12] Use dev docker tag --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index be7c599c16e..363fec75ad1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ concurrency: jobs: build: runs-on: ubuntu-latest - container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:9.5 + container: ghcr.io/sagemath/sage/sage-docker-ubuntu-focal-standard-with-targets:dev steps: - name: Checkout uses: actions/checkout@v2