Skip to content

Commit

Permalink
Merge pull request #148 from lefessan/z-2021-02-25-improvements
Browse files Browse the repository at this point in the history
fixes
  • Loading branch information
lefessan authored Jul 9, 2021
2 parents b06bd70 + aaeb90e commit 9e01733
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 18 deletions.
2 changes: 1 addition & 1 deletion share/drom/skeletons/projects/mini_lib/drom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for-test = true
[project]
pack-modules = true
skip-dirs = []
skip = "test sphinx github docs ocamlformat ocp-indent"
skip = "@test @sphinx @docs @ocamlformat @ocp-indent"

[[package]]
skeleton = "library"
Expand Down
2 changes: 1 addition & 1 deletion share/drom/skeletons/projects/mini_prg/drom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ for-test = true
[project]
pack-modules = true
skip-dirs = []
skip = "test sphinx github docs ocamlformat ocp-indent"
skip = "@test @sphinx @docs @ocamlformat @ocp-indent"

[[package]]
skeleton = "program"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
jobs:
doc-deploy:
runs-on: !{ci-first-system}

!(github-worlflow-env)
steps:
- name: checkout
uses: actions/checkout@v2
Expand Down Expand Up @@ -39,6 +39,7 @@ jobs:
if: steps.cache-opam.outputs.cache-hit != 'true'
- run: opam upgrade --fixup
if: steps.cache-opam.outputs.cache-hit == 'true'
!(github-workflow-before-doc)
- name: build-doc
run: |
make doc
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
![fi]

runs-on: ${{ matrix.os }}

!(github-worlflow-env)
steps:
- name: Checkout code
uses: actions/checkout@v2
Expand Down Expand Up @@ -58,19 +58,19 @@ jobs:
- run: opam pin add . -y --no-action

- run: opam depext -y !{packages}
if: steps.cache-opam.outputs.cache-hit != 'true'
# if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam install -y ./*.opam --deps-only --with-test
if: steps.cache-opam.outputs.cache-hit != 'true'
# if: steps.cache-opam.outputs.cache-hit != 'true'

- run: opam upgrade --fixup
if: steps.cache-opam.outputs.cache-hit == 'true'
# - run: opam upgrade --fixup
# if: steps.cache-opam.outputs.cache-hit == 'true'

- run: dos2unix scripts/*.sh
if: matrix.os == 'windows-latest'

!(github-workflow-before-build)
- run: make build

!(github-workflow-after-build)
- name: run test suite
run: |
./scripts/before.sh test
Expand Down
31 changes: 23 additions & 8 deletions src/drom_lib/subst.ml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ let maybe_string = function
| None -> ""
| Some s -> s

let with_buffer f =
let b = Buffer.create 100 in
f b ;
Buffer.contents b

let project_brace (_, p) v =
match v with
| "name" -> p.package.name
Expand Down Expand Up @@ -144,14 +149,24 @@ let project_brace (_, p) v =
github_organization p.package.name )
| "sphinx-target" -> Misc.sphinx_target p
| "odoc-target" -> Misc.odoc_target p
| "badge-ci" -> (
match p.github_organization with
| None -> ""
| Some github_organization ->
Printf.sprintf
"[![Actions \
Status](https://github.com/%s/%s/workflows/Main%%20Workflow/badge.svg)](https://github.com/%s/%s/actions)"
github_organization p.package.name github_organization p.package.name )
| "badge-ci" ->
begin
match p.github_organization with
| None -> ""
| Some github_organization ->
with_buffer (fun b ->
List.iter (fun workflow ->
Printf.bprintf b
"[![Actions \
Status](https://github.com/%s/%s/workflows/%s/badge.svg)](https://github.com/%s/%s/actions)"
github_organization p.package.name
workflow
github_organization p.package.name )
[ "Main%20Workflow";
"doc-deploy"
]
)
end
| "badge-release" -> (
match p.github_organization with
| None -> ""
Expand Down

0 comments on commit 9e01733

Please sign in to comment.