Skip to content

Commit c644ddf

Browse files
committed
add Steel CI with FStarLang/FStar#2349
1 parent c03ceeb commit c644ddf

File tree

2 files changed

+117
-0
lines changed

2 files changed

+117
-0
lines changed

Diff for: .docker/steel.Dockerfile

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# This Dockerfile should be run from the root EverParse directory
2+
3+
ARG ocaml_version=4.12
4+
FROM ocaml/opam:ubuntu-ocaml-$ocaml_version
5+
6+
ADD --chown=opam:opam ./ $HOME/everparse/
7+
WORKDIR $HOME/everparse
8+
9+
# CI dependencies: jq (to identify F* branch)
10+
RUN sudo apt-get update && sudo apt-get install -y --no-install-recommends jq
11+
12+
# Dependencies (F*, Karamel and opam packages)
13+
ENV FSTAR_HOME=$HOME/FStar
14+
ENV KRML_HOME=$HOME/karamel
15+
ENV FSTAR_BRANCH=john_ml_steel_c
16+
RUN eval $(opam env) && .docker/build/install-deps.sh
17+
18+
# CI proper
19+
ARG CI_THREADS=24
20+
21+
ENV STEEL_C=1
22+
RUN eval $(opam env) && make -j $CI_THREADS steel-unit-test
23+
24+
WORKDIR $HOME
25+
ENV EVERPARSE_HOME=$HOME/everparse

Diff for: .github/workflows/steel.yaml

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Build and test EverParse+Steel
2+
on:
3+
push:
4+
branches-ignore:
5+
- _**
6+
- taramana_steel
7+
pull_request:
8+
workflow_dispatch:
9+
jobs:
10+
build:
11+
runs-on: [self-hosted, linux, X64]
12+
steps:
13+
- name: Record initial timestamp
14+
run: |
15+
echo "CI_INITIAL_TIMESTAMP=$(date '+%s')" >> $GITHUB_ENV
16+
- name: Check out repo
17+
uses: actions/checkout@v2
18+
- name: Identify the base FStar branch and the notification channel
19+
run: |
20+
echo "FSTAR_BRANCH=john_ml_steel_c" >> $GITHUB_ENV
21+
echo "CI_SLACK_CHANNEL=$(jq -c -r '.NotificationChannel' .docker/build/config.json)" >> $GITHUB_ENV
22+
- name: Build Everparse and its dependencies
23+
run: |
24+
ci_docker_image_tag=everparse:local-run-$GITHUB_RUN_ID-$GITHUB_RUN_ATTEMPT
25+
ci_docker_builder=builder_everparse_${GITHUB_RUN_ID}_${GITHUB_RUN_ATTEMPT}
26+
docker buildx create --name $ci_docker_builder --driver-opt env.BUILDKIT_STEP_LOG_MAX_SIZE=500000000
27+
docker buildx build --builder $ci_docker_builder --pull --load -t $ci_docker_image_tag -f .docker/steel.Dockerfile .
28+
docker buildx rm -f $ci_docker_builder
29+
env:
30+
DZOMO_GITHUB_TOKEN: ${{ secrets.DZOMO_GITHUB_TOKEN }}
31+
- name: Compute elapsed time
32+
if: ${{ always() }}
33+
run: |
34+
CI_FINAL_TIMESTAMP=$(date '+%s')
35+
CI_TIME_DIFF=$(( $CI_FINAL_TIMESTAMP - $CI_INITIAL_TIMESTAMP ))
36+
echo "CI_TIME_DIFF_S=$(( $CI_TIME_DIFF % 60 ))" >> $GITHUB_ENV
37+
echo "CI_TIME_DIFF_M=$(( ($CI_TIME_DIFF / 60) % 60 ))" >> $GITHUB_ENV
38+
echo "CI_TIME_DIFF_H=$(( $CI_TIME_DIFF / 3600 ))" >> $GITHUB_ENV
39+
case ${{ job.status }} in
40+
(success)
41+
echo "CI_EMOJI=✅" >> $GITHUB_ENV
42+
;;
43+
(cancelled)
44+
echo "CI_EMOJI=⚠" >> $GITHUB_ENV
45+
;;
46+
(*)
47+
echo "CI_EMOJI=❌" >> $GITHUB_ENV
48+
;;
49+
esac
50+
echo "CI_COMMIT=$(echo ${{ github.event.head_commit.id || github.event.pull_request.head.sha }} | grep -o '^........')" >> $GITHUB_ENV
51+
- name: Post to the Slack channel
52+
if: ${{ always() }}
53+
id: slack
54+
uses: slackapi/[email protected]
55+
with:
56+
channel-id: ${{ env.CI_SLACK_CHANNEL }}
57+
payload: |
58+
{
59+
"blocks" : [
60+
{
61+
"type": "section",
62+
"text": {
63+
"type": "mrkdwn",
64+
"text": "<${{ github.event.head_commit.url || github.event.pull_request.html_url }}|${{ env.CI_COMMIT }}> on (${{ github.ref_name }}) by ${{ github.event.head_commit.author.username || github.event.pull_request.user.login }}"
65+
}
66+
},
67+
{
68+
"type": "section",
69+
"text": {
70+
"type": "plain_text",
71+
"text": ${{ toJSON(github.event.head_commit.message || github.event.pull_request.title) }}
72+
}
73+
},
74+
{
75+
"type": "section",
76+
"text": {
77+
"type": "mrkdwn",
78+
"text": "${{ env.CI_EMOJI }} <https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}|${{ job.status }}>"
79+
}
80+
},
81+
{
82+
"type": "section",
83+
"text": {
84+
"type": "plain_text",
85+
"text": "Duration: ${{ env.CI_TIME_DIFF_H }}h ${{ env.CI_TIME_DIFF_M }}min ${{ env.CI_TIME_DIFF_S }}s"
86+
}
87+
}
88+
]
89+
}
90+
env:
91+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
92+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK

0 commit comments

Comments
 (0)