Skip to content

Commit

Permalink
Try #1831:
Browse files Browse the repository at this point in the history
  • Loading branch information
bors[bot] authored Nov 21, 2020
2 parents 1892e75 + cf14263 commit 8ab1c62
Show file tree
Hide file tree
Showing 21 changed files with 497 additions and 252 deletions.
75 changes: 61 additions & 14 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
strategy:
fail-fast: false
matrix:
build: [linux, macos, windows, linux-aarch64]
build: [linux, macos, macos-arm64, windows, linux-aarch64]
include:
- build: linux
os: ubuntu-18.04
Expand All @@ -55,6 +55,11 @@ jobs:
artifact_name: 'wasmer-macos-amd64'
cross_compilation_artifact_name: 'cross_compiled_from_mac'
run_integration_tests: true
- build: macos-arm64
os: macos-11.0
rust: nightly
target: aarch64-apple-darwin
artifact_name: 'wasmer-macos-arm64'
- build: windows
os: windows-latest
rust: 1.47.0
Expand Down Expand Up @@ -83,7 +88,15 @@ jobs:
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
target: ${{ matrix.target }}
override: true
- name: Setup Rust target
run: |
cat << EOF > .cargo/config.toml
[build]
target = "aarch64-apple-darwin"
EOF
if: matrix.target == 'aarch64-apple-darwin'
- name: Configure cargo data directory
# After this point, all cargo registry and crate data is stored in
# $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
Expand All @@ -102,9 +115,9 @@ jobs:
target/*/.*
target/*/build
target/*/deps
key: ${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
key: v1-${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.rust }}-
v1-${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
# # Install sccache
# - uses: actions/cache@master
# with:
Expand All @@ -131,7 +144,7 @@ jobs:
# echo "LLVM_SYS_100_PREFIX=C:/llvm-10" >> $GITHUB_ENV
# echo "LIBCLANG_PATH=C:/llvm-10/bin/libclang.dll" >> $GITHUB_ENV
- name: Install LLVM (Unix)
if: matrix.os != 'windows-latest'
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin'
run: |
curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz
mkdir -p ${{ env.LLVM_DIR }}
Expand All @@ -141,14 +154,25 @@ jobs:
env:
LLVM_DIR: ${{ github.workspace }}/llvm-10
- name: Set up dependencies for Mac OS
run: brew install automake
if: matrix.os == 'macos-latest'
- run: make test
- name: Build and Test C API
run: |
brew install automake
if: matrix.os == 'macos-latest' || matrix.os == 'macos-11.0'
- name: Test
run: |
make test
if: matrix.target != 'aarch64-apple-darwin'
- name: Test C API
run: |
make test-capi
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' # we can't test yet on Apple Silicon or Windows
- name: Build C API
run: |
make build-capi
if: matrix.os != 'windows-latest'
if: matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin'
- name: Build C API
run: |
make build-capi-cranelift-system-libffi
if: matrix.target == 'aarch64-apple-darwin'
- name: Build C API on Windows
run: make build-capi
if: matrix.os == 'windows-latest'
Expand All @@ -158,14 +182,27 @@ jobs:
- name: Build Wapm binary
run: |
make build-wapm
if: needs.setup.outputs.DOING_RELEASE == '1'
# if: needs.setup.outputs.DOING_RELEASE == '1'
- name: Copy target binaries for packaging
run: |
mkdir -p target/release
cp target/${{matrix.target}}/release/wasmer* target/release
cp target/${{matrix.target}}/release/libwasmer* target/release
mkdir -p wapm-cli/target/release
cp wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
if: matrix.target
# if: needs.setup.outputs.DOING_RELEASE == '1'
- name: Package Wasmer for integration tests
run: make package-without-wapm-for-integration-tests
if: needs.setup.outputs.DOING_RELEASE != '1'
- name: Package Wasmer
run: |
make package
if: needs.setup.outputs.DOING_RELEASE == '1'
# if: needs.setup.outputs.DOING_RELEASE == '1'
- name: Package Wasmer (${{ matrix.target }})
run: |
mv ./dist/$(shell ./scripts/binary-name.sh) ./dist/{{ matrix.artifact_name }}.tar.gz
if: matrix.target && matrix.os != 'windows-latest'
- name: Run integration tests (Windows)
shell: cmd
run: |
Expand Down Expand Up @@ -220,7 +257,7 @@ jobs:
path: cross
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: needs.setup.outputs.DOING_RELEASE == '1'
# if: needs.setup.outputs.DOING_RELEASE == '1'
with:
name: ${{ matrix.artifact_name }}
path: dist
Expand Down Expand Up @@ -313,8 +350,8 @@ jobs:
asset_path: artifacts/wasmer-linux-amd64/wasmer-linux-amd64.tar.gz
asset_name: wasmer-linux-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac
id: upload-release-asset-mac
- name: Upload Release Asset Mac amd64
id: upload-release-asset-mac-amd64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -323,6 +360,16 @@ jobs:
asset_path: artifacts/wasmer-macos-amd64/wasmer-darwin-amd64.tar.gz
asset_name: wasmer-darwin-amd64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Mac arm64
id: upload-release-asset-mac-arm64
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-macos-amd64/wasmer-darwin-arm64.tar.gz
asset_name: wasmer-darwin-arm64.tar.gz
asset_content_type: application/gzip
- name: Upload Release Asset Linux aarch64
id: upload-release-asset-linux-aarch64
uses: actions/upload-release-asset@v1
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

### Added

- [#1831](https://github.com/wasmerio/wasmer/pull/1831) Added support for Apple Silicon chips (`arm64-apple-darwin`)
- [#1649](https://github.com/wasmerio/wasmer/pull/1649) Add outline of migration to 1.0.0 docs.

### Changed
Expand Down
Loading

0 comments on commit 8ab1c62

Please sign in to comment.