Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiimk committed Feb 8, 2024
1 parent 33947fa commit 70f347f
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 2 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@ jobs:
include:
- runs-on: ubuntu-latest
target: x86_64-unknown-linux-musl
# - runs-on: macos-14
# target: aarch64-apple-darwin
image-arch: linux/amd64
- runs-on: macos-14
target: aarch64-apple-darwin
image-arch: linux/arm/v8
name: Build
runs-on: ${{ matrix.runs-on }}
steps:
Expand Down
71 changes: 71 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: test_macos
on:
push: {}
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- runs-on: ubuntu-latest
target: x86_64-unknown-linux-musl
image-platform: linux/amd64

# Cross-compiles from Intel Mac to arm64
# We can compile natively for arm64 using macos-14 runner,
# but M1 processors of macos-14 runner don't support docker.
# See: https://github.com/marketplace/actions/setup-docker-on-macos#arm64-processors-m1-m2-m3-series-used-on-macos-14-images-are-unsupported
- runs-on: macos-13
target: aarch64-apple-darwin
image-platform: linux/arm/v8
name: Build
runs-on: ${{ matrix.runs-on }}
steps:
- name: Setup variables
run: |
TAG=${{ github.ref }}
VERSION=${TAG#v}
echo "VERSION=$VERSION" >> $GITHUB_ENV
echo "IMAGE=ghcr.io/kamu-data/engine-datafusion:$VERSION" >> $GITHUB_ENV
- name: Install docker (macOS)
if: contains(matrix.runs-on, 'macos-')
# See: https://blog.netnerds.net/2022/11/docker-macos-github-actions/
run: |
brew install docker
colima start
- name: Install musl (linux)
if: contains(matrix.target, '-musl')
# See: https://blog.urth.org/2023/03/05/cross-compiling-rust-projects-in-github-actions/
run: |
sudo apt-get update --yes
sudo apt-get install --yes musl-tools
- uses: actions/checkout@v4

- uses: actions-rs/toolchain@v1
with:
target: ${{ matrix.target }}
override: true

- name: Log in to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build binary
run: |
cargo build --release --target ${{ matrix.target }}
- name: Build image
run: |
docker build \
--platform ${{ matrix.image-platform }} \
--build-arg target_arch=${{ matrix.target }} \
--build-arg version=${{ env.VERSION }} \
-t ${{ env.IMAGE }} \
-f image/Dockerfile \
.

0 comments on commit 70f347f

Please sign in to comment.