From 4f88086ba3db38289049806fef574113b6b82177 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 17 Feb 2021 19:00:45 +0100 Subject: [PATCH 1/5] experimenting with nix ci --- .github/workflows/main.yml | 2 +- .github/workflows/nix.yml | 47 +++++++++++++++++++ .nix/config.nix | 2 + .nix/coq-overlays/mathcomp-single/default.nix | 7 +++ 4 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/nix.yml create mode 100644 .nix/coq-overlays/mathcomp-single/default.nix diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9dc3eccc2..ce0cfe408 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,6 +1,6 @@ # This is a basic workflow to help you get started with Actions -name: CI +name: docker CI # Controls when the action will run. Triggers the workflow on push or pull request # events but only for the master branch diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml new file mode 100644 index 000000000..77975a88e --- /dev/null +++ b/.github/workflows/nix.yml @@ -0,0 +1,47 @@ +# This is a basic workflow to help you get started with Actions + +name: nix CI + +# Controls when the action will run. Triggers the workflow on push or pull request +# events but only for the master branch +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + nix: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: cachix/install-nix-action@v12 + - uses: cachix/cachix-action@v8 + with: + name: coq + - uses: cachix/cachix-action@v8 + with: + name: math-comp + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - run: nix-build + + nixci: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - uses: cachix/install-nix-action@v12 + - uses: cachix/cachix-action@v8 + with: + name: coq + - uses: cachix/cachix-action@v8 + with: + name: math-comp + authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' + - needs: nix + - run: nix-build --arg ci true diff --git a/.nix/config.nix b/.nix/config.nix index eadab65be..535edc14c 100644 --- a/.nix/config.nix +++ b/.nix/config.nix @@ -6,5 +6,7 @@ select = "coq-8.13"; inputs."coq-8.13".coqPackages = { coq.override.version = "8.13"; + mathcomp.override.version = "gares:hierarchy-builder"; + mathcomp-single.ci = true; }; } diff --git a/.nix/coq-overlays/mathcomp-single/default.nix b/.nix/coq-overlays/mathcomp-single/default.nix new file mode 100644 index 000000000..b7cb66d9f --- /dev/null +++ b/.nix/coq-overlays/mathcomp-single/default.nix @@ -0,0 +1,7 @@ +{ mathcomp, coq-elpi, hierarchy-builder, version ? null }: +(mathcomp.override {single = true;}).overrideAttrs (old: { + buildPhase = "make -j $(max_jobs) -C mathcomp ./algebra/ssralg.vo"; + propagatedBuildInputs = old.propagatedBuildInputs ++ + [ coq-elpi hierarchy-builder ]; + installPhase = "echo NO INSTALL" +}) From 596daaf9196cbdc5dee8703e0c32eee49a7efe57 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 17 Feb 2021 19:03:20 +0100 Subject: [PATCH 2/5] needs --- .github/workflows/nix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 77975a88e..09f52cc67 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -30,6 +30,7 @@ jobs: nixci: runs-on: ubuntu-latest + needs: nix steps: - uses: actions/checkout@v2 @@ -43,5 +44,4 @@ jobs: with: name: math-comp authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - - needs: nix - run: nix-build --arg ci true From 2097ef7d505a01e8b3c81939d99064ceffab61cb Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 17 Feb 2021 19:04:56 +0100 Subject: [PATCH 3/5] fix installphase --- .nix/coq-overlays/mathcomp-single/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.nix/coq-overlays/mathcomp-single/default.nix b/.nix/coq-overlays/mathcomp-single/default.nix index b7cb66d9f..228f5f62d 100644 --- a/.nix/coq-overlays/mathcomp-single/default.nix +++ b/.nix/coq-overlays/mathcomp-single/default.nix @@ -3,5 +3,5 @@ buildPhase = "make -j $(max_jobs) -C mathcomp ./algebra/ssralg.vo"; propagatedBuildInputs = old.propagatedBuildInputs ++ [ coq-elpi hierarchy-builder ]; - installPhase = "echo NO INSTALL" + installPhase = "echo NO INSTALL"; }) From c26133eb6b45dc3e7cf4f3b1bb45f491ccdbe595 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 17 Feb 2021 19:05:44 +0100 Subject: [PATCH 4/5] deduplication --- .github/workflows/main.yml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ce0cfe408..c6c3a7dc6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -11,19 +11,6 @@ on: branches: [ master ] jobs: - nix: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - uses: cachix/install-nix-action@v12 - - uses: cachix/cachix-action@v8 - with: - name: coq - - run: nix-build - opam: runs-on: ubuntu-latest strategy: From e8b01282c120db64335a440589a9da2d09807807 Mon Sep 17 00:00:00 2001 From: Cyril Cohen Date: Wed, 17 Feb 2021 19:22:03 +0100 Subject: [PATCH 5/5] simplify --- .github/workflows/nix.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 09f52cc67..7b840d580 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -19,12 +19,10 @@ jobs: with: fetch-depth: 0 - uses: cachix/install-nix-action@v12 - - uses: cachix/cachix-action@v8 - with: - name: coq - uses: cachix/cachix-action@v8 with: name: math-comp + extraPullNames: coq authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix-build @@ -37,11 +35,9 @@ jobs: with: fetch-depth: 0 - uses: cachix/install-nix-action@v12 - - uses: cachix/cachix-action@v8 - with: - name: coq - uses: cachix/cachix-action@v8 with: name: math-comp + extraPullNames: coq authToken: '${{ secrets.CACHIX_AUTH_TOKEN }}' - run: nix-build --arg ci true