Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM hexpm/elixir:1.20.2-erlang-29.0.2-debian-trixie-20260623-slim

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV LC_ALL=C.UTF-8
ENV CC=gcc-14
ENV CXX=g++-14

RUN apt-get update && \
apt-get dist-upgrade --yes && \
apt-get install --yes --no-install-recommends \
build-essential \
ca-certificates \
cmake \
curl \
g++-14 \
gcc-14 \
git \
inotify-tools \
ninja-build \
openssh-client \
pkg-config \
python3 \
python3-venv \
sudo \
zsh && \
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-14 140 && \
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-14 140 && \
update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-14 140 && \
update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-14 140 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN useradd -m -s /bin/zsh -u 1000 -G sudo dev && \
echo 'dev ALL=(ALL) NOPASSWD:ALL' > /etc/sudoers.d/dev && \
chmod 0440 /etc/sudoers.d/dev && \
mkdir -p /workspace && \
chown dev:dev /workspace

USER dev

RUN git config --global --add safe.directory /workspace && \
mix local.hex --force && \
mix local.rebar --force

WORKDIR /workspace
24 changes: 24 additions & 0 deletions .devcontainer/devcontainer-lock.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"version": "2.5.9",
"resolved": "ghcr.io/devcontainers/features/common-utils@sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a",
"integrity": "sha256:cb0c4d3c276f157eed17935747e364178d75fee17f55c4e129966f64633deb3a"
},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"version": "1.10.0",
"resolved": "ghcr.io/devcontainers/features/docker-outside-of-docker@sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e",
"integrity": "sha256:c2c2cf829505ead8e4892c88c31b6594ae94a2bbb209e16e1fac456c1a3a624e"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "1.3.7",
"resolved": "ghcr.io/devcontainers/features/git@sha256:a3e43ff91b9f5f6bd2c14bd510d43e5e698f1266dc41027ba4e04e7e45be607a",
"integrity": "sha256:a3e43ff91b9f5f6bd2c14bd510d43e5e698f1266dc41027ba4e04e7e45be607a"
},
"ghcr.io/devcontainers/features/github-cli:1": {
"version": "1.1.0",
"resolved": "ghcr.io/devcontainers/features/github-cli@sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671",
"integrity": "sha256:d22f50b70ed75339b4eed1ba9ecde3a1791f90e88d37936517e3bace0bbad671"
}
}
}
33 changes: 33 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"name": "EXGBoost Erlang 29 GCC 14",
"build": {
"dockerfile": "Dockerfile",
"context": ".."
},
"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,consistency=cached",
"workspaceFolder": "/workspace",
"containerEnv": {
"CC": "gcc-14",
"CXX": "g++-14",
"MIX_ENV": "dev"
},
"customizations": {
"vscode": {
"extensions": [
"jakebecker.elixir-ls"
]
}
},
"postCreateCommand": "mix deps.get",
"remoteUser": "dev",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"configureZshAsDefaultShell": true
},
"ghcr.io/devcontainers/features/git:1": {},
"ghcr.io/devcontainers/features/github-cli:1": {},
"ghcr.io/devcontainers/features/docker-outside-of-docker:1": {
"moby": false
}
}
}
22 changes: 18 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,28 @@ jobs:
test:
name: Test OTP ${{ matrix.otp }} / Elixir ${{ matrix.elixir }}
runs-on: ubuntu-24.04
env:
CC: gcc-14
CXX: g++-14
MIX_ENV: test
strategy:
fail-fast: false
matrix:
otp: ["28.3"]
elixir: ["1.18.4", "1.19.5"]
include:
- otp: "28.3"
elixir: "1.18.4"
- otp: "28.3"
elixir: "1.19.5"
- otp: "29.0.2"
elixir: "1.20.2"

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake ninja-build gcc-14 g++-14

- uses: erlef/setup-beam@v1
with:
Expand All @@ -36,4 +50,4 @@ jobs:
run: mix format --check-formatted

- name: Run tests
run: MIX_ENV=test mix test
run: MIX_ENV=test mix test
37 changes: 18 additions & 19 deletions .github/workflows/precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@ jobs:
runs-on: ubuntu-24.04
env:
MIX_ENV: "prod"
CC: gcc-14
CXX: g++-14
strategy:
matrix:
otp: ["28.3"]
elixir: ["1.18.4", "1.19.5"]
include:
- otp: "28.3"
elixir: "1.18.4"
- otp: "28.3"
elixir: "1.19.5"
- otp: "29.0.2"
elixir: "1.20.2"
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v5
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
Expand All @@ -24,10 +31,11 @@ jobs:
run: |
mix local.hex --force
mix local.rebar --force
- name: Install system dependecies
- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip \
cmake ninja-build gcc-14 g++-14 \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- name: Mix Test
Expand All @@ -46,25 +54,16 @@ jobs:
cache/*.tar.gz

macos:
runs-on: ${{matrix.runner}}
# Homebrew supports versioned Erlang/OTP but not Elixir
# It's a deliberate design decision from Homebrew to
# only support versioned distributions for certain packages
name: Mac (ARM) Erlang/OTP ${{matrix.otp}} / Elixir
runs-on: macos-15
name: Mac (ARM) Erlang/OTP 29.0.2 / Elixir 1.20.2
env:
MIX_ENV: "prod"
strategy:
matrix:
runner: ["macos-15"]
otp: ["27.0", "28.0"]
elixir: ["1.18.4"]
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
- uses: actions/checkout@v5
- uses: erlef/setup-beam@v1
with:
tool_versions: |
erlang ${{matrix.otp}}
elixir ${{matrix.elixir}}
otp-version: "29.0.2"
elixir-version: "1.20.2"
- name: Install libomp
run: |
brew install libomp
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ erl_crash.dump
*.beam
/config/*.secret.exs
.elixir_ls/
.tool-versions
.vscode/
checksum.exs
.DS_Store
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,21 @@ else
endif

$(EXGBOOST_SO): $(EXGBOOST_CACHE_SO)
@ mkdir -p $(PRIV_DIR)
@mkdir -p $(PRIV_DIR)
cp -a $(abspath $(EXGBOOST_CACHE_LIB_DIR)) $(EXGBOOST_LIB_DIR) ; \
cp -a $(abspath $(EXGBOOST_CACHE_SO)) $(EXGBOOST_SO) ;

$(EXGBOOST_CACHE_SO): $(XGBOOST_LIB_DIR_FLAG) $(C_SRCS)
@mkdir -p cache
cp -a $(XGBOOST_LIB_DIR) $(EXGBOOST_CACHE_LIB_DIR)
cp -R $(XGBOOST_LIB_DIR) $(EXGBOOST_CACHE_LIB_DIR)
cp $(XGBOOST_DIR)/lib/$(LIBXGBOOST) $(EXGBOOST_CACHE_LIB_DIR)
$(CC) $(CFLAGS) $(wildcard $(EXGBOOST_DIR)/src/*.c) $(LDFLAGS) -o $(EXGBOOST_CACHE_SO)
$(POST_INSTALL)

# This new target handles fetching the source code.
# It only runs if the .git directory inside the source folder is missing.
$(XGBOOST_DIR)/.git:
mkdir -p $(XGBOOST_DIR) && \
@mkdir -p $(XGBOOST_DIR) && \
cd $(XGBOOST_DIR) && \
git init && \
git remote add origin $(XGBOOST_GIT_REPO) && \
Expand Down
Loading
Loading