Skip to content

Commit

Permalink
compose jobs with arch
Browse files Browse the repository at this point in the history
  • Loading branch information
warmwaffles committed Sep 14, 2024
1 parent 2f7e17e commit 8ce08ca
Showing 1 changed file with 26 additions and 25 deletions.
51 changes: 26 additions & 25 deletions .github/workflows/linux-precompile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,15 @@ jobs:
MIX_ENV: prod
strategy:
matrix:
arch:
- x86_64
- aarch64
- riscv64
job:
- {otp: "27", elixir: "1.17", nif: "2.17"}
- {otp: "25", elixir: "1.16", nif: "2.16"}
- {otp: "27", elixir: "1.17"}
- {otp: "25", elixir: "1.16"}

name: Linux x86_64 - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
name: Linux ${{ matrix.arch }} - OTP ${{ matrix.job.otp }} - Elixir ${{ matrix.job.elixir }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -41,37 +45,34 @@ jobs:
gcc-powerpc64le-linux-gnu g++-powerpc64le-linux-gnu \
gcc-s390x-linux-gnu g++-s390x-linux-gnu
- name: Get musl cross-compilers
- name: Get musl ${{ matrix.arch }} cross-compilers
run: |
for musl_arch in x86_64 aarch64 riscv64
do
wget "https://musl.cc/${musl_arch}-linux-musl-cross.tgz" -O "${musl_arch}-linux-musl-cross.tgz"
tar -xf "${musl_arch}-linux-musl-cross.tgz"
done
wget "https://musl.cc/${{matrix.arch}}-linux-musl-cross.tgz" -O "${{matrix.arch}}-linux-musl-cross.tgz"
tar -xf "${{matrix.arch}}-linux-musl-cross.tgz"
- name: Create precompiled x86_64 library
- name: Create precompiled ${{ matrix.arch }} library
run: |
export PATH="$(pwd)/x86_64-linux-musl-cross/bin:${PATH}"
export PATH="$(pwd)/${{ matrix.arch }}-linux-musl-cross/bin:${PATH}"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
- name: Create precompiled aarch64 library
run: |
export PATH="$(pwd)/aarch64-linux-musl-cross/bin:${PATH}"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
# - name: Create precompiled aarch64 library
# run: |
# export PATH="$(pwd)/aarch64-linux-musl-cross/bin:${PATH}"
# export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
# mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
# mix deps.get
# mix elixir_make.precompile

- name: Create precompiled riscv64 library
run: |
export PATH="$(pwd)/riscv64-linux-musl-cross/bin:${PATH}"
export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
mix deps.get
mix elixir_make.precompile
# - name: Create precompiled riscv64 library
# run: |
# export PATH="$(pwd)/riscv64-linux-musl-cross/bin:${PATH}"
# export ELIXIR_MAKE_CACHE_DIR=$(pwd)/cache
# mkdir -p "${ELIXIR_MAKE_CACHE_DIR}"
# mix deps.get
# mix elixir_make.precompile

- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
Expand Down

0 comments on commit 8ce08ca

Please sign in to comment.