Build #498
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
name: Build | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
# Since cargo and opam dependencies change over time, we schedule a build of | |
# the container every week so we can catch issues early on | |
schedule: | |
# Run at 1AM UTC every Saturday; this translates to 9AM HKT and 9PM EST | |
# (new york outside of DST) | |
- cron: "0 1 * * 6" | |
env: | |
CARGO_TERM_COLOR: always | |
jobs: | |
# In the past we tried to support building this on 32bit architectures,[1] but | |
# some of polars' crates clearly don't support it[2] and getting both the | |
# OCaml and Rust compilers to work on 32bit is a pain, so we are leaving | |
# this comment as a reminder so that we do not try this without sufficient | |
# motivation again. | |
# | |
# [1]: https://github.com/mt-caret/polars-ocaml/pull/64 | |
# [2]: https://github.com/pola-rs/polars/blob/c4fdbfe2c7f7ce7616ad9301981bc5d616c3beef/crates/polars-row/src/row.rs#L21 | |
build: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout (GitHub) | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ github.token }} | |
- name: Build and run Dev Container task | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ghcr.io/mt-caret/polars-ocaml | |
cacheFrom: ghcr.io/mt-caret/polars-ocaml | |
refFilterForPush: refs/heads/main | |
runCmd: | | |
opam exec -- dune build | |
opam exec -- dune runtest | |
verify-minimum-supported-rust-version: | |
runs-on: self-hosted | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout (GitHub) | |
uses: actions/checkout@v4 | |
- name: Login to GitHub Container Registry | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ github.token }} | |
- name: | |
uses: devcontainers/[email protected] | |
with: | |
imageName: ghcr.io/mt-caret/polars-ocaml | |
cacheFrom: ghcr.io/mt-caret/polars-ocaml | |
runCmd: | | |
apt install --yes pkg-config libssl-dev | |
cargo install cargo-msrv | |
cd ./rust/polars-ocaml && cargo msrv verify | |
rust-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# We need nightly, at least until | |
# https://github.com/mt-caret/polars-ocaml/pull/30 is merged. | |
- uses: dtolnay/rust-toolchain@nightly | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- uses: ocaml/setup-ocaml@v2 | |
with: | |
ocaml-compiler: 4.14.x | |
# These environment variables are used by ocaml-sys to figure out which | |
# version of OCaml we're building for | |
- name: Set opam env | |
run: opam env | tr '\n' ' ' >> $GITHUB_ENV | |
- name: Add opam switch to PATH | |
run: opam var bin >> $GITHUB_PATH | |
- name: Install mold | |
run: sudo apt install --yes mold | |
- name: Check | |
run: cargo check --verbose | |
working-directory: ./rust | |
- name: Clippy | |
run: cargo clippy -- --deny warnings | |
working-directory: ./rust | |
- name: Rust format | |
run: cargo fmt --all -- --check | |
working-directory: ./rust | |
- name: Run tests | |
run: cargo test --verbose | |
working-directory: ./rust | |
ocaml-checks: | |
runs-on: ubuntu-latest | |
steps: | |
- 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 |