Skip to content

Commit 16a020a

Browse files
authored
Merge pull request #5 from erikmd/warn-error
Demo for coq-problem-matcher (warn/error)
2 parents 5ca4334 + f2afb7b commit 16a020a

File tree

4 files changed

+70
-37
lines changed

4 files changed

+70
-37
lines changed
Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# This is a basic workflow to help you get started with Actions
2-
1+
# This is a workflow example relying on docker-coq-action
32
name: CI
43

5-
# Controls when the action will run.
6-
# cf. https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#filtering-for-specific-branches-tags-and-paths
4+
# Controls when the action will run:
5+
# https://help.github.com/en/actions/configuring-and-managing-workflows/configuring-a-workflow#filtering-for-specific-branches-tags-and-paths
76
# Triggers the workflow on push events or pull request events for the
87
# master branch only:
98
on:
@@ -15,59 +14,31 @@ on:
1514
- master
1615

1716
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
17+
# This workflow contains two jobs, build and mathcomp:
1818
jobs:
19-
# This workflow contains a single job called "build"
2019
build:
2120
# The type of runner that the job will run on;
2221
# the OS must be GNU/Linux to be able to use the docker-coq-action
2322
runs-on: ubuntu-latest
24-
2523
strategy:
2624
matrix:
2725
coq_version:
2826
- 8.11
2927
- dev
3028
ocaml_version: ['4.07-flambda']
31-
# at most 20 concurrent jobs per free account
32-
# cf. https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#usage-limits
29+
# at most 20 concurrent jobs per free account:
30+
# https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#usage-limits
3331
max-parallel: 4
3432

3533
# Steps represent a sequence of tasks that will be executed as part of the job
3634
steps:
3735
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
3836
- uses: actions/checkout@v2
39-
4037
- uses: erikmd/docker-coq-action@master
41-
id: docker-coq-action
4238
with:
4339
opam_file: 'coq-demo.opam'
4440
coq_version: ${{ matrix.coq_version }}
4541
ocaml_version: ${{ matrix.ocaml_version }}
46-
custom_script: |
47-
startGroup Test UID+GID
48-
pwd
49-
ls -hal
50-
touch test || true
51-
id
52-
sudo chown -R coq:coq .
53-
touch test
54-
ls -hal
55-
stat -c "UID=%u,GID=%g %n" $WORKDIR/$PACKAGE.opam
56-
endGroup
57-
startGroup Print opam config
58-
opam config list; opam repo list; opam list
59-
endGroup
60-
startGroup Fetch dependencies
61-
opam pin add -n -y -k path $PACKAGE $WORKDIR
62-
opam update -y
63-
endGroup
64-
startGroup Build
65-
opam install -y -v -j 2 $PACKAGE
66-
opam list
67-
endGroup
68-
startGroup Uninstallation test
69-
opam remove $PACKAGE
70-
endGroup
7142

7243
mathcomp:
7344
runs-on: ubuntu-latest
@@ -82,7 +53,12 @@ jobs:
8253
steps:
8354
- uses: actions/checkout@v2
8455
- uses: erikmd/docker-coq-action@master
85-
id: docker-mathcomp-action
8656
with:
8757
opam_file: './coq-demo.opam'
8858
custom_image: ${{ matrix.image }}
59+
60+
# Remark:
61+
# you may want to add the following badge to your README.md:
62+
# [![CI](https://github.com/$USER/$REPO/workflows/CI/badge.svg?branch=master)](https://github.com/$USER/$REPO/actions?query=workflow%3ACI)
63+
# after replacing $USER/$REPO to use your project namespace; note also
64+
# that CI is the workflow name, defined at the beginning of this file.

.github/workflows/misc-test.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# a few tests, not intended for demo purposes
2+
name: misc-test
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
pull_request:
9+
branches:
10+
- master
11+
12+
jobs:
13+
uid-test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- run: id
18+
- uses: erikmd/docker-coq-action@master
19+
with:
20+
opam_file: './coq-demo.opam'
21+
coq_version: 'latest'
22+
ocaml_version: '4.07-flambda'
23+
custom_script: |
24+
# small test, not intended for demo purposes
25+
startGroup Test UID+GID
26+
id
27+
pwd
28+
ls -hal
29+
stat -c "UID=%u,GID=%g %n" $WORKDIR/$PACKAGE.opam
30+
endGroup
31+
startGroup Print opam config
32+
opam config list; opam repo list; opam list
33+
endGroup

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,17 @@
55
Demo of:
66

77
* [docker-coq-action](https://github.com/erikmd/docker-coq-action),
8-
* [Docker-Coq](https://hub.docker.com/r/coqorg/coq) images,
8+
* [docker-coq](https://hub.docker.com/r/coqorg/coq) and
9+
[docker-mathcomp](https://hub.docker.com/r/mathcomp/mathcomp) images,
910
* and a workflow named [build-coq-demo.yml](./.github/workflows/build-coq-demo.yml),
1011
* relying on [coq-demo.opam](./coq-demo.opam)
12+
13+
Note: you can add a badge in your `README.md`, like that of this demo:
14+
15+
```
16+
[![CI](https://github.com/$USER/$REPO/workflows/CI/badge.svg?branch=master)](https://github.com/$USER/$REPO/actions?query=workflow%3ACI)
17+
```
18+
19+
after replacing `$USER/$REPO` to use your project namespace; note also
20+
that CI is the workflow name, defined at the beginning of [this file](
21+
./.github/workflows/build-coq-demo.yml).

src/demo.v

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,16 @@ Proof.
1010
idtac "proof in progress...".
1111
now intros P [H1 H2]; apply H1; apply H2; intros HP; apply H1.
1212
Qed.
13+
14+
Variable A : Prop. (* raise a warning *)
15+
Lemma identity : A -> A.
16+
Proof.
17+
easy.
18+
Qed.
19+
20+
Lemma eqs : forall a b c : nat, (a, b) = (b, a) -> b = c -> a = c.
21+
move=> a b c Hab Hc.
22+
case: Hab=>->_.
23+
case: Hc=>->. (* raise a warning *)
24+
done.
25+
Qed.

0 commit comments

Comments
 (0)