Skip to content

Merge pull request #35 from billylanchantin/bl-refactor-training-logic #36

Merge pull request #35 from billylanchantin/bl-refactor-training-logic

Merge pull request #35 from billylanchantin/bl-refactor-training-logic #36

Workflow file for this run

name: precompile
on: push
jobs:
linux:
name: Linux Erlang/OTP ${{matrix.otp}} / Elixir ${{matrix.elixir}}
runs-on: ubuntu-20.04
env:
MIX_ENV: "prod"
strategy:
matrix:
# Elixir 1.14.5 is first version compatible with OTP 26
# NIF versionsss change according to
# https://github.com/erlang/otp/blob/dd57c853a324a9572a9e5ce227d8675ff004c6fe/erts/emulator/beam/erl_nif.h#L33
otp: ["25.0", "26.0"]
elixir: ["1.14.5"]
steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
with:
otp-version: ${{matrix.otp}}
elixir-version: ${{matrix.elixir}}
- name: Install system dependecies
run: |
sudo apt-get update
sudo apt-get install -y build-essential automake autoconf pkg-config bc m4 unzip zip \
gcc-aarch64-linux-gnu g++-aarch64-linux-gnu \
gcc-riscv64-linux-gnu g++-riscv64-linux-gnu
- name: Mix Test
run: |
mix deps.get
MIX_ENV=test mix test
- name: Create precompiled library
run: |
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
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 distrinutions for certin packages
name: Mac (${{ matrix.runner == 'macos-latest' && 'Intel' || 'ARM' }}) Erlang/OTP ${{matrix.otp}} / Elixir
env:
MIX_ENV: "prod"
strategy:
matrix:
runner: ["macos-latest", "self-hosted"]
otp: ["25.0", "26.0"]
elixir: ["1.14.5"]
steps:
- uses: actions/checkout@v3
- uses: asdf-vm/actions/install@v2
with:
tool_versions: |
erlang ${{matrix.otp}}
elixir ${{matrix.elixir}}
- name: Install libomp
run: |
brew install libomp
mix local.hex --force
mix local.rebar --force
- name: Mix Test
run: |
mix deps.get
MIX_ENV=test mix test
- name: Create precompiled library
run: |
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix elixir_make.precompile
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
${{ matrix.runner == 'macos-latest' && 'cache/*x86_64*.tar.gz' || 'cache/*aarch64*.tar.gz' }}
- name: Cleanup # We need this since self-hosted runners are not ephemeral
run: |
make clean