Skip to content

Commit

Permalink
Prepare to publish on opam: CI
Browse files Browse the repository at this point in the history
  • Loading branch information
lukstafi committed May 8, 2024
1 parent 82f0c0e commit 73990a5
Show file tree
Hide file tree
Showing 6 changed files with 102 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: ci
on:
push:
branches:
- master
pull_request:
jobs:
run:
name: Build
strategy:
matrix:
os:
- ubuntu-latest
- macos-latest
# The CI does not support OCaml version 5.1 yet (at the time of writing).
# - windows-latest
# Either the waiting queue for FreeBSD is very long, or it is not available.
# - freebsd-latest
ocaml-compiler:
- 5.1.x
# - 5.2.x
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: Jimver/[email protected]
id: cuda-toolkit
# with:
# cuda: '12.4.1'
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: ${{ matrix.ocaml-compiler }}
dune-cache: true
allow-prerelease-opam: true
- run: opam pin -n .
- run: opam depext -yt cudajit
- run: opam install . --deps-only --with-test --with-doc
- run: opam exec -- dune build
- run: opam exec -- dune runtest
44 changes: 44 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: github pages

on:
push:
branches:
- master # Set a branch name to trigger deployment

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main

- name: Cache opam
id: cache-opam
uses: actions/cache@v2
with:
path: ~/.opam
key: opam-ubuntu-latest-5.1.1

# - uses: actions/checkout@v2
- uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: '5.1.1'

- name: Pin
run: opam pin -n .

- name: Depext
run: opam depext -yt ocannl_npy arrayjit neural_nets_lib

- name: Deps
run: opam install -d . --deps-only

- name: Build
run: opam exec -- dune build @doc

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./_build/default/_doc/_html/
# destination_dir: dev
enable_jekyll: true
12 changes: 11 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
## [v0.1.0] 2023-10-28
## [0.1.1] 2024-05-08

### Added

- Continuous Integration on GitHub thanks to GitHub action Jimver/cuda-toolkit.

### Fixed

- Test target should erase compiler versions.

## [0.1.0] 2023-10-28

### Added

Expand Down
2 changes: 1 addition & 1 deletion cudajit.opam
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This file is generated by dune, edit dune-project instead
opam-version: "2.0"
version: "0.1.0"
version: "0.1.1"
synopsis:
"Bindings to the `cuda` and `nvrtc` libraries with a unified interface"
description:
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

(name cudajit)

(version 0.1.0)
(version 0.1.1)

(generate_opam_files true)

Expand Down
11 changes: 7 additions & 4 deletions test/saxpy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,18 @@ let%expect_test "SAXPY compilation" =
in
(match prog.log with None -> () | Some log -> Format.printf "\nCUDA Compile log: %s\n%!" log);
[%expect {| CUDA Compile log: |}];
Format.printf "PTX: %s\n%!" @@ Cudajit.string_from_ptx prog;
Format.printf "PTX: %s%!" @@ Str.global_replace
(Str.regexp
{|CL-[0-9]+\|release [0-9]+\.[0-9]+\|V[0-9]+\.[0-9]+\.[0-9]+\|NVVM [0-9]+\.[0-9]+\.[0-9]+|})
"NNN" @@ Cudajit.string_from_ptx prog;
[%expect
{|
PTX: //
// Generated by NVIDIA NVVM Compiler
//
// Compiler Build ID: CL-33281558
// Cuda compilation tools, release 12.3, V12.3.52
// Based on NVVM 7.0.1
// Compiler Build ID: NNN
// Cuda compilation tools, NNN, NNN
// Based on NNN
//

.version 8.3
Expand Down

0 comments on commit 73990a5

Please sign in to comment.