You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
neovide/.github/workflows/build.yml

208 lines
5.7 KiB
YAML

name: Build-and-Test
on:
push:
paths-ignore:
- 'website/**'
- '.vscode/**'
- '**.md'
env:
CARGO_TERM_COLOR: always
jobs:
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Install Nightly Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v1
- name: Check Formatting
run: |
cargo fmt --all -- --check
- name: Install Neovim
run: |
choco install -y neovim
- name: Add Neovim to PATH
run: echo "C:\tools\neovim\nvim-win64\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Test
env:
NEOVIM_BIN: "C:/tools/neovim/nvim-win64/bin/nvim.exe"
RUST_BACKTRACE: full
run: |
cargo nextest run --profile ci
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: target/nextest/ci/results.xml
- name: Build Release
run: |
cargo build --release
- uses: actions/upload-artifact@v2
with:
name: neovide-windows
path: ./target/release/neovide.exe
build-mac:
runs-on: macos-11
steps:
- uses: actions/checkout@v2
- name: Install Nightly Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Add x86_64 target
run: |
rustup target add x86_64-apple-darwin
- name: Add aarch64 target
run: |
rustup target add aarch64-apple-darwin
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Install Utilities
run: |
cargo install cargo-bundle
- uses: Swatinem/rust-cache@v1
- name: Check Formatting
run: |
cargo fmt --all -- --check
- name: Install Neovim
run: |
brew install neovim
- name: Test
env:
RUST_BACKTRACE: full
run: |
cargo nextest run --profile ci
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action/composite@v1
if: always()
with:
files: target/nextest/ci/results.xml
- name: Build x86 app
env:
MACOSX_DEPLOYMENT_TARGET: "10.11"
run: |
cargo build --release --target=x86_64-apple-darwin
cargo bundle --release --target=x86_64-apple-darwin
- name: Build aarch64 app
env:
MACOSX_DEPLOYMENT_TARGET: "10.11"
run: |
cargo build --release --target=aarch64-apple-darwin
cargo bundle --release --target=aarch64-apple-darwin
- name: Merge into a universal app
run: |
mkdir -p target/release/bundle/osx
rm -rf target/release/bundle/osx/Neovide.app || true
cp -R target/x86_64-apple-darwin/release/bundle/osx/Neovide.app \
target/release/bundle/osx/Neovide.app
rm target/release/bundle/osx/Neovide.app/Contents/MacOS/neovide
lipo target/x86_64-apple-darwin/release/bundle/osx/Neovide.app/Contents/MacOS/neovide \
target/aarch64-apple-darwin/release/bundle/osx/Neovide.app/Contents/MacOS/neovide \
-create -output \
target/release/bundle/osx/Neovide.app/Contents/MacOS/neovide
codesign --force --deep -s - target/release/bundle/osx/Neovide.app
- name: Create .dmg file
run: |
hdiutil create Neovide-uncompressed.dmg -volname "Neovide" -srcfolder target/release/bundle/osx
hdiutil convert Neovide-uncompressed.dmg -format UDZO -o Neovide.dmg
- uses: actions/upload-artifact@v1
with:
name: Neovide.dmg
path: ./Neovide.dmg
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Nightly Toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
override: true
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- uses: Swatinem/rust-cache@v1
- name: Check Formatting
run: |
cargo fmt --all -- --check
- name: Install dependencies and neovim
run: |
sudo apt-get update
sudo apt-get -qq install -y \
curl gnupg ca-certificates git gcc-multilib g++-multilib cmake libssl-dev pkg-config libfreetype6-dev libasound2-dev libexpat1-dev libxcb-composite0-dev libbz2-dev freeglut3-dev libxi-dev\
neovim
- name: Test
env:
RUST_BACKTRACE: full
run: |
cargo nextest run --profile ci
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
if: always()
with:
files: target/nextest/ci/results.xml
- name: Build Release
run: |
cargo build --release
- name: Archive Linux artifact
run: |
cd ./target/release/
strip neovide
tar czvf neovide.tar.gz neovide
- uses: actions/upload-artifact@v1
with:
name: neovide-linux.tar.gz
path: ./target/release/neovide.tar.gz