Skip to content

Commit

Permalink
Deploy odoc to GitHub Pages (#112)
Browse files Browse the repository at this point in the history
Signed-off-by: Sora Morimoto <sora@morimoto.io>
  • Loading branch information
smorimoto authored Jan 4, 2024
1 parent 3d6925f commit 820f691
Show file tree
Hide file tree
Showing 5 changed files with 73 additions and 16 deletions.
21 changes: 11 additions & 10 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@ jobs:
packages: write
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ github.token }}

- name: Build and run Dev Container task
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/mt-caret/polars-ocaml
cacheFrom: ghcr.io/mt-caret/polars-ocaml
push: always
refFilterForPush: refs/heads/main
runCmd: |
opam exec -- dune build
opam exec -- dune runtest
Expand All @@ -57,21 +57,20 @@ jobs:
packages: write
steps:
- name: Checkout (GitHub)
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
password: ${{ github.token }}

- name:
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/mt-caret/polars-ocaml
cacheFrom: ghcr.io/mt-caret/polars-ocaml
push: always
runCmd: |
apt install --yes pkg-config libssl-dev
cargo install cargo-msrv
Expand All @@ -80,7 +79,7 @@ jobs:
rust-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

# We need nightly, at least until
# https://github.com/mt-caret/polars-ocaml/pull/30 is merged.
Expand Down Expand Up @@ -118,10 +117,12 @@ jobs:
ocaml-checks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.x

- uses: ocaml/setup-ocaml/lint-opam@v2

- uses: ocaml/setup-ocaml/lint-fmt@v2
54 changes: 54 additions & 0 deletions .github/workflows/odoc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Deploy odoc to GitHub Pages

on:
push:
branches:
- main

permissions: read-all

concurrency:
group: deploy-odoc
cancel-in-progress: true

jobs:
deploy-odoc:
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
id-token: write
pages: write

steps:
- name: Checkout (GitHub)
uses: actions/checkout@v4

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build documentation
uses: devcontainers/ci@v0.3
with:
imageName: ghcr.io/mt-caret/polars-ocaml
cacheFrom: ghcr.io/mt-caret/polars-ocaml
runCmd: |
opam exec -- dune build @doc
- name: Set-up Pages
uses: actions/configure-pages@v4

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: _build/default/_doc/_html

- name: Deploy odoc to GitHub Pages
id: deployment
uses: actions/deploy-pages@v3
11 changes: 6 additions & 5 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
(source
(github mt-caret/polars-ocaml))

(authors "mtakeda")
(authors mtakeda)

(maintainers "mtakeda")
(maintainers mtakeda)

(license MIT)

Expand All @@ -25,6 +25,8 @@
(core_bench :with-test)
(expect_test_helpers_core :with-test)
(mdx :with-test)
(ocaml
(< 5.0.0))
(ocamlformat :dev)
(odoc :with-doc)
(re2 :with-test)
Expand All @@ -35,8 +37,6 @@
core_unix
dune
; ocaml-interop does not yet properly support OCaml 5
(ocaml
(< 5.0.0))
ppx_jane
ppx_typed_fields)
(tags
Expand All @@ -56,6 +56,7 @@
(shell :with-test)
async
core
polars)
polars
ppx_jane)
(tags
(data-science polars rust)))
2 changes: 1 addition & 1 deletion polars.opam
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ depends: [
"core_bench" {with-test}
"expect_test_helpers_core" {with-test}
"mdx" {with-test}
"ocaml" {< "5.0.0"}
"ocamlformat" {dev}
"odoc" {with-doc}
"re2" {with-test}
Expand All @@ -22,7 +23,6 @@ depends: [
"core_kernel"
"core_unix"
"dune" {>= "3.8"}
"ocaml" {< "5.0.0"}
"ppx_jane"
"ppx_typed_fields"
]
Expand Down
1 change: 1 addition & 0 deletions polars_async.opam
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ depends: [
"async"
"core"
"polars"
"ppx_jane"
]
build: [
["dune" "subst"] {dev}
Expand Down

0 comments on commit 820f691

Please sign in to comment.