sqld in github action #42
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: TestSuite | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
# schedule: | |
# - cron: '15 * * * *' | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-22.04 | |
ocaml-compiler: | |
- 4.14.1 | |
runs-on: ${{ matrix.os }} | |
env: | |
USERNAME: "vim" | |
USER_UID: 1000 | |
USER_GID: 1000 | |
container: | |
image: ocaml/opam:${{ matrix.os }} | |
options: --user root | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
dune-cache: true | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
opam-disable-sandboxing: true | |
- name: Cache opam dependencies | |
uses: actions/cache@v2 | |
id: opam-cache | |
with: | |
path: ~/.opam | |
key: ${{ runner.os }}-opam-${{ hashFiles('**/*.opam') }} | |
restore-keys: | | |
${{ runner.os }}-opam- | |
- name: Install Common Libs | |
run: opam install async base uri cohttp cohttp-lwt-unix cohttp-async lwt core_kernel ssl lwt_ssl jose alcotest alcotest-lwt qcheck dune ocamlformat | |
# - name: Install Repo | |
# run: opam install . --deps-only --with-doc --with-test | |
- name: Dune Build | |
run: opam exec -- dune build | |
env: | |
LIBSQL_TOKEN: ${{ secrets.LIBSQL_TOKEN }} | |
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }} | |
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }} | |
- name: install rust | |
run: curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh -s -- -y && . "$HOME/.cargo/env" | |
- name: sqld deps | |
run: apt-get install gcc g++ make libclang-dev -y | |
- name: sqld Build | |
run: git clone https://github.com/libsql/sqld.git && cd sqld && sed -i 's/setup_14/setup_18/g' ./scripts/install-deps.sh && ./scripts/install-deps.sh && . "$HOME/.cargo/env" && cargo build && ./target/debug/sqld --http-listen-addr 0.0.0.0:8000 | |
env: | |
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }} | |
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }} | |
- name: Dune Test | |
run: opam exec -- dune runtest 2>&1 | tee dune_runtest.log | |
env: | |
LIBSQL_TOKEN: ${{ secrets.LIBSQL_TOKEN }} | |
LIBSQL_HOST: ${{ secrets.LIBSQL_HOST }} | |
LIBSQL_PORT: ${{ secrets.LIBSQL_PORT }} | |
- name: Upload Log | |
uses: actions/upload-artifact@v2 | |
with: | |
name: dune_runtest | |
path: dune_runtest.log | |
lint-doc: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-22.04 | |
ocaml-compiler: | |
- 4.14.1 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
dune-cache: true | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
opam-disable-sandboxing: true | |
- name: Lint doc | |
uses: ocaml/setup-ocaml/lint-doc@v2 | |
lint-fmt: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-22.04 | |
ocaml-compiler: | |
- 4.14.1 | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Use OCaml ${{ matrix.ocaml-compiler }} | |
uses: ocaml/setup-ocaml@v2 | |
with: | |
dune-cache: true | |
ocaml-compiler: ${{ matrix.ocaml-compiler }} | |
opam-disable-sandboxing: true | |
- name: Lint fmt | |
uses: ocaml/setup-ocaml/lint-fmt@v2 |