forked from Kakadu/fp2024
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (91 loc) · 3.81 KB
/
master.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Build master
on:
#pull_request:
# branches:
# - 'master'
push:
paths-ignore:
- 'README.md'
- 'exam.md'
branches:
- 'master'
env:
OPAMROOT: /home/user/.opam
OPAMYES: true
OPAMCONFIRMLEVEL: unsafe-yes
jobs:
build:
defaults:
run:
shell: bash
runs-on: ubuntu-latest
container:
image: kakadu18/ocaml:fp2024
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- run: ls -la
#- run: git log
#- run: git diff --name-only HEAD~0 HEAD~1
############# Detecting and compiling fp202x
# Smart link about setting environment variables
# https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions#setting-an-environment-variable
- name: Detect latest changes in ${{ github.event.repository.name }}
run: |
opam exec -- ocaml .github/detect_latest_pr.ml -master -repo ${{ github.event.repository.name }} >> $GITHUB_ENV
echo "${{ env.latest }}"
- name: Installing dependencies for ${{ env.latest }}
run: cd ${{ env.latest }} && opam install . --deps-only --with-test --with-doc --yes
- if: false
name: Checking ocamlformat
run: |
cd ${{ env.latest }} && opam exec -- dune build @fmt --profile=release
- name: Compiling ${{ env.latest }}...
run: cd ${{ env.latest }} && opam exec -- dune build --profile=release
- name: Running tests in ${{ env.latest }}...
run: cd ${{ env.latest }} && opam exec -- dune runtest --profile=release
- name: Build API documentation for ${{ env.latest }}...
if: false
run: |
opam install odoc --yes
cd ${{ env.latest }} && opam exec -- dune build @doc --profile=release
# - uses: actions/checkout@v4
# with:
# repository: Kakadu/zanuda
# path: zanuda
# - run: opam pin add ./zanuda --no-action
# - name: Installing linter
# run: opam install zanuda --yes --with-doc
# - run: echo "RDJSON_DIR_PATH=_build/default/_found_lints" >> $GITHUB_ENV
# - run: cd ${{ env.latest }} && mkdir -p ${{ env.RDJSON_DIR_PATH }}
# - run: echo "RDJSON_FILE_PATH=${{ env.RDJSON_DIR_PATH }}/lints.rdjsonl" >> $GITHUB_ENV
# - name: Running linter in ${{ env.latest }}...
# run: cd ${{ env.latest }} && opam exec -- zanuda -dir . -add-prefix ${{ env.latest }}/ -ordjsonl ${{ env.RDJSON_FILE_PATH }}
# github has a limit on annotations. pr-review seems not have this limitation
# Error: reviewdog: Too many results (annotations) in diff.
# You may miss some annotations due to GitHub limitation for annotation created by logging command.
# Please check GitHub Actions log console to see all results.
# Limitation:
# - 10 warning annotations and 10 error annotations per step
# - 50 annotations per job (sum of annotations from all the steps)
# - 50 annotations per run (separate from the job annotations, these annotations aren't created by users)
# - name: Run reviewdog check (1/5)
# if: ${{ true }}
# continue-on-error: true
# env:
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_TOKEN1 }}
# run: >
# cat ${{ env.latest }}/${{ env.RDJSON_FILE_PATH }} |
# sed -n '1,49p' |
# reviewdog -f=rdjsonl -filter-mode nofilter -reporter=github-pr-check
#- name: Run reviewdog
# env:
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.REVIEWDOG_TOKEN1 }}
# run: >
# cat ${{ env.latest }}/${{ env.RDJSON_FILE_PATH }} |
# reviewdog -f=rdjsonl -filter-mode nofilter -reporter=github-pr-review