Skip to content

Commit 2c34167

Browse files
committed
[ci] GH actions for windows, linux and osx
1 parent 173b9f5 commit 2c34167

1 file changed

Lines changed: 135 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Main doc: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/introduction-to-github-actions
2+
# Runners spec: https://docs.github.com/en/free-pro-team@latest/actions/reference/specifications-for-github-hosted-runners
3+
# Glob expressions: https://github.com/actions/toolkit/tree/main/packages/glob
4+
5+
name: Coq Platform CI
6+
7+
###############################################################################
8+
# Schedule:
9+
# - push on any branch whose name matches v** or master
10+
# - any pull request
11+
###############################################################################
12+
on:
13+
push:
14+
branches:
15+
- v**
16+
- master
17+
pull_request:
18+
branches:
19+
- '**'
20+
21+
###############################################################################
22+
# Platform script options shared among all jobs
23+
###############################################################################
24+
env:
25+
PLATFORM_ARGS: -extent=f -parallel=p -jobs=2 -vst=y -compcert=f
26+
COQREGTESTING: y
27+
28+
jobs:
29+
###############################################################################
30+
# Windows
31+
#
32+
# 2 jobs, the former builds the installer, the second tests it
33+
#
34+
# CAVEATS:
35+
# - git is misconfigured, by default it puts \r in between \n\n
36+
###############################################################################
37+
Windows_platform:
38+
name: Windows
39+
runs-on: windows-latest
40+
41+
steps:
42+
- name: Set git to use LF
43+
run: |
44+
git config --global core.autocrlf false
45+
git config --global core.eol lf
46+
47+
- name: Git checkout
48+
uses: actions/checkout@v2
49+
50+
- name: Run common platform script
51+
shell: cmd
52+
run: coq_platform_make_windows.bat -destcyg=C:\cygwin64_coq_platform -arch=64 %PLATFORM_ARGS%
53+
54+
- name: Create installer
55+
shell: cmd
56+
run: C:\cygwin64_coq_platform\bin\bash --login -c "cd coq-platform/ && windows/create_installer_windows.sh && mkdir /cygdrive/c/installer && cp windows_installer/*exe /cygdrive/c/installer/"
57+
58+
- name: 'Upload Artifact'
59+
uses: actions/upload-artifact@v2
60+
with:
61+
name: 'Windows installer 64 bits'
62+
path: C:\installer\*.exe
63+
retention-days: 5
64+
65+
Windows_smoke:
66+
name: Smoke test
67+
needs: Windows_platform
68+
runs-on: windows-latest
69+
70+
steps:
71+
- name: 'Download Artifact'
72+
uses: actions/download-artifact@v2
73+
with:
74+
name: 'Windows installer 64 bits'
75+
76+
- name: 'Run Installer'
77+
shell: cmd
78+
run: |
79+
CD C:\installer\
80+
FOR %%f IN (*.exe) DO %%f /S /D=C:\Coq
81+
82+
- name: 'Smoke coqc'
83+
shell: cmd
84+
run: C:\Coq\bin\coqc.exe -v
85+
86+
###############################################################################
87+
# Ubuntu
88+
#
89+
# CAVEATS:
90+
# - you need bubblewrap or the script fails
91+
# - build-essential pulls in the C toolchain
92+
###############################################################################
93+
Ubuntu_platform:
94+
name: Ubuntu
95+
runs-on: ubuntu-latest
96+
97+
steps:
98+
- name: Git checkout
99+
uses: actions/checkout@v2
100+
101+
- name: Install bubblewrap and build-essential
102+
run: |
103+
sudo apt-get update
104+
sudo apt-get install bubblewrap build-essential
105+
106+
- name: Run common platform script
107+
shell: bash
108+
run: ./coq_platform_make.sh $PLATFORM_ARGS
109+
110+
###############################################################################
111+
# Macos
112+
#
113+
# CAVEATS:
114+
# - COQREGTESTING broken, it makes the script loop, so we install opam by hand
115+
###############################################################################
116+
Macos_platform:
117+
name: Macos
118+
runs-on: macos-latest
119+
120+
steps:
121+
- name: Git checkout
122+
uses: actions/checkout@v2
123+
124+
- name: Install opam
125+
env:
126+
OPAM_VERSION: 2.0.7
127+
run: |
128+
curl -L https://github.com/ocaml/opam/releases/download/${OPAM_VERSION}/opam-${OPAM_VERSION}-x86_64-macos > opam.${OPAM_VERSION}
129+
chmod a+x opam.${OPAM_VERSION}
130+
sudo cp opam.${OPAM_VERSION} /usr/local/bin/opam.${OPAM_VERSION}
131+
sudo ln -s /usr/local/bin/opam.${OPAM_VERSION} /usr/local/bin/opam
132+
133+
- name: Run common platform script
134+
shell: bash
135+
run: ./coq_platform_make.sh $PLATFORM_ARGS

0 commit comments

Comments
 (0)