Skip to content

Commit 9e80790

Browse files
authored
Merge pull request #181 from proux01/ci-warnings
Check absence of warning only on last release
2 parents bb11e7f + 416256e commit 9e80790

File tree

5 files changed

+64
-2
lines changed

5 files changed

+64
-2
lines changed

.github/workflows/nix-action-rocq-9.0.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7778,6 +7778,60 @@ jobs:
77787778
name: Building/fetching current CI target
77797779
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
77807780
--argstr job "stdlib-refman-html"
7781+
stdlib-warnings:
7782+
needs: []
7783+
runs-on: ubuntu-latest
7784+
steps:
7785+
- name: Determine which commit to initially checkout
7786+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"target_commit=${{
7787+
github.sha }}\" >> $GITHUB_ENV\nelse\n echo \"target_commit=${{ github.event.pull_request.head.sha
7788+
}}\" >> $GITHUB_ENV\nfi\n"
7789+
- name: Git checkout
7790+
uses: actions/checkout@v4
7791+
with:
7792+
fetch-depth: 0
7793+
ref: ${{ env.target_commit }}
7794+
- name: Determine which commit to test
7795+
run: "if [ ${{ github.event_name }} = \"push\" ]; then\n echo \"tested_commit=${{
7796+
github.sha }}\" >> $GITHUB_ENV\nelse\n merge_commit=$(git ls-remote ${{ github.event.repository.html_url
7797+
}} refs/pull/${{ github.event.number }}/merge | cut -f1)\n mergeable=$(git
7798+
merge --no-commit --no-ff ${{ github.event.pull_request.base.sha }} > /dev/null
7799+
2>&1; echo $?; git merge --abort > /dev/null 2>&1 || true)\n if [ -z \"$merge_commit\"\
7800+
\ -o \"x$mergeable\" != \"x0\" ]; then\n echo \"tested_commit=${{ github.event.pull_request.head.sha
7801+
}}\" >> $GITHUB_ENV\n else\n echo \"tested_commit=$merge_commit\" >> $GITHUB_ENV\n\
7802+
\ fi\nfi\n"
7803+
- name: Git checkout
7804+
uses: actions/checkout@v4
7805+
with:
7806+
fetch-depth: 0
7807+
ref: ${{ env.tested_commit }}
7808+
- name: Cachix install
7809+
uses: cachix/install-nix-action@v31
7810+
with:
7811+
nix_path: nixpkgs=channel:nixpkgs-unstable
7812+
- name: Cachix setup coq
7813+
uses: cachix/cachix-action@v16
7814+
with:
7815+
authToken: ${{ secrets.CACHIX_AUTH_TOKEN }}
7816+
extraPullNames: coq-community, math-comp
7817+
name: coq
7818+
- id: stepGetDerivation
7819+
name: Getting derivation for current job (stdlib-warnings)
7820+
run: "NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link \\\n --argstr bundle
7821+
\"rocq-9.0\" --argstr job \"stdlib-warnings\" \\\n --dry-run 2> err > out
7822+
|| (touch fail; true)\ncat out err\nif [ -e fail ]; then echo \"Error: getting
7823+
derivation failed\"; exit 1; fi\n"
7824+
- id: stepCheck
7825+
name: Checking presence of CI target for current job
7826+
run: "if $(cat out err | grep -q \"built:\") ; then\n echo \"CI target needs
7827+
actual building\"\n if $(cat out err | grep -q \"derivations will be built:\"\
7828+
) ; then\n echo \"waiting a bit for derivations that should be in cache\"\
7829+
\n sleep 30\n fi\nelse\n echo \"CI target already built\"\n echo \"\
7830+
status=fetched\" >> $GITHUB_OUTPUT\nfi\n"
7831+
- if: steps.stepCheck.outputs.status != 'fetched'
7832+
name: Building/fetching current CI target
7833+
run: NIXPKGS_ALLOW_UNFREE=1 nix-build --no-out-link --argstr bundle "rocq-9.0"
7834+
--argstr job "stdlib-warnings"
77817835
stdpp:
77827836
needs:
77837837
- coq

.nix/config.nix

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ with builtins; with (import <nixpkgs> {}).lib;
233233
}; };
234234
"rocq-9.0" = { rocqPackages = common-bundles // {
235235
rocq-core.override.version = "9.0.0";
236+
# check that we compile without warnings on last release of Coq
237+
stdlib-warnings.job = true;
236238
}; coqPackages = coq-common-bundles // {
237239
coq.override.version = "9.0.0";
238240
# plugin pins, from v9.0 branch of Coq
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{ stdlib }: stdlib.overrideAttrs {
2+
preConfigure = ''
3+
echo "-arg -w -arg +default" > theories/_CoqProject.tmp
4+
cat theories/_CoqProject >> theories/_CoqProject.tmp
5+
mv theories/_CoqProject.tmp theories/_CoqProject
6+
'';
7+
}

theories/_CoqProject

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
-R . Stdlib
2-
-arg -w -arg +default

theories/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
(env
77
(dev
88
(coq
9-
(flags :standard -w +default))))
9+
(flags :standard))))
1010

1111
(rule
1212
(targets All.v)

0 commit comments

Comments
 (0)