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 + 7923225 commit dfa1e67
Show file tree
Hide file tree
Showing 22 changed files with 508 additions and 317 deletions.
85 changes: 62 additions & 23 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,20 @@ jobs:
- name: Build Wapm binary
run: |
make build-wapm
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
# if: needs.setup.outputs.DOING_RELEASE == '1'
- name: Copy target binaries
run: |
mkdir -p target/release
cp target/${{matrix.target}}/release/wasmer* target/release
cp target/${{matrix.target}}/release/libwasmer* target/release
if [ -d "wapm-cli" ]; then
mkdir -p wapm-cli/target/release
wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
fi
if: matrix.target
- name: Dist
run: |
make package
if: needs.setup.outputs.DOING_RELEASE == '1'
make distribution
- name: Run integration tests (Windows)
shell: cmd
run: |
Expand Down Expand Up @@ -220,7 +250,6 @@ jobs:
path: cross
- name: Upload Artifacts
uses: actions/upload-artifact@v2
if: needs.setup.outputs.DOING_RELEASE == '1'
with:
name: ${{ matrix.artifact_name }}
path: dist
Expand Down Expand Up @@ -300,7 +329,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: artifacts/wasmer-windows-amd64/wasmer-windows.exe
asset_path: artifacts/wasmer-windows-amd64/WasmerInstaller.exe
asset_name: wasmer-windows.exe
asset_content_type: application/vnd.microsoft.portable-executable
- name: Upload Release Asset Linux amd64
Expand All @@ -310,27 +339,37 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-amd64/wasmer-linux-amd64.tar.gz
asset_path: artifacts/wasmer-linux-amd64/wasmer.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 }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-macos-amd64/wasmer-darwin-amd64.tar.gz
asset_path: artifacts/wasmer-macos-amd64/wasmer.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.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
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/wasmer-linux-aarch64/wasmer-linux-aarch64.tar.gz
asset_path: artifacts/wasmer-linux-aarch64/wasmer.tar.gz
asset_name: wasmer-linux-aarch64.tar.gz
asset_content_type: application/gzip

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 dfa1e67

Please sign in to comment.