Skip to content

Use wayland clipboard #5

Use wayland clipboard

Use wayland clipboard #5

Workflow file for this run

name: Build and Test
permissions:
checks: write
contents: read
on:
push:
paths-ignore:
- "website/**"
- ".vscode/**"
- "**.md"
env:
CARGO_TERM_COLOR: always
defaults:
run:
shell: bash # necessary for windows
jobs:
lint:
uses: ./.github/workflows/lint-app.yml
test:
needs: lint
strategy:
fail-fast: false
matrix:
os: [windows-latest, macOS-12, ubuntu-latest]
toolchain: [stable, nightly]
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.toolchain == 'nightly' }}
steps:
- uses: actions/checkout@v3
- name: Setup toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: ${{ matrix.toolchain }}
- name: Show toolchain info
run: cargo --version --verbose
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
- name: Install cargo-nextest
uses: taiki-e/install-action@nextest
- name: Test
env:
RUST_BACKTRACE: full
run: |
cargo nextest run --profile ci
mv target/nextest/ci/results.xml target/nextest/ci/results-${{ matrix.os }}.xml
- name: Prepare test results
run: |
mkdir -p test-results
mv target/nextest/ci/results-*.xml test-results/
- name: Upload test results
uses: actions/upload-artifact@v3
with:
name: test-results
path: |
test-results
event-upload:
needs: test
name: Upload Test Event
runs-on: ubuntu-latest
steps:
- uses: actions/upload-artifact@v3
with:
name: test-event
path: ${{ github.event_path }}
build-deploy:
needs: test
strategy:
fail-fast: false
matrix:
# NOTE: Should use the oldest available Ubuntu release, for maximum compatibility
os: [windows-latest, macOS-12, ubuntu-20.04]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- uses: actions/cache@v3
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
target/
key: ${{ matrix.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
- name: Install dependencies
run: |
if [[ $RUNNER_OS == "Windows" ]]; then
if ! which cargo-wix; then cargo install cargo-wix; fi
elif [[ $RUNNER_OS == "macOS" ]]; then
rustup target add x86_64-apple-darwin
rustup target add aarch64-apple-darwin
if ! which cargo-bundle; then cargo install cargo-bundle; fi
elif [[ $RUNNER_OS == "Linux" ]]; then
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 libfuse2 appstream
fi
- name: Install neovim
uses: rhysd/action-setup-vim@v1
with:
neovim: true
- name: Build
run: |
if [[ $RUNNER_OS == "Windows" ]]; then
cargo wix --output target/release/neovide.msi --package neovide
elif [[ $RUNNER_OS == "macOS" ]]; then
echo "MACOSX_DEPLOYMENT_TARGET=10.11" >> $GITHUB_ENV
# x86
cargo build --locked --release --target=x86_64-apple-darwin
cargo bundle --release --target=x86_64-apple-darwin
# arch
cargo build --locked --release --target=aarch64-apple-darwin
cargo bundle --release --target=aarch64-apple-darwin
elif [[ $RUNNER_OS == "Linux" ]]; then
cargo build --locked --release
fi
- name: Prepare Artifacts
run: |
cd target/release
if [[ $RUNNER_OS == "Windows" ]]; then
echo "ARTIFACT=neovide.exe" >> $GITHUB_ENV
echo "ARTIFACT2=neovide.msi" >> $GITHUB_ENV
elif [[ $RUNNER_OS == "macOS" ]]; then
# merge builds
mkdir -p bundle/osx
rm -rf bundle/osx/neovide.app || true
cp -R ../x86_64-apple-darwin/release/bundle/osx/neovide.app \
bundle/osx/neovide.app
rm bundle/osx/neovide.app/Contents/MacOS/neovide
lipo ../x86_64-apple-darwin/release/bundle/osx/neovide.app/Contents/MacOS/neovide \
../aarch64-apple-darwin/release/bundle/osx/neovide.app/Contents/MacOS/neovide \
-create -output \
bundle/osx/neovide.app/Contents/MacOS/neovide
codesign --force --deep -s - bundle/osx/neovide.app
# create .dmg
hdiutil create neovide-uncompressed.dmg -volname "neovide" -srcfolder bundle/osx
hdiutil convert neovide-uncompressed.dmg -format UDZO -o neovide.dmg
echo "ARTIFACT=neovide.dmg" >> $GITHUB_ENV
elif [[ $RUNNER_OS == "Linux" ]]; then
# archive artifact
strip neovide
tar czvf neovide-linux-x86_64.tar.gz neovide
# create appimage
curl -Lo linuxdeploy https://github.com/linuxdeploy/linuxdeploy/releases/latest/download/linuxdeploy-x86_64.AppImage
chmod +x linuxdeploy
curl -Lo linuxdeploy-plugin-appimage https://github.com/linuxdeploy/linuxdeploy-plugin-appimage/releases/latest/download/linuxdeploy-plugin-appimage-x86_64.AppImage
chmod +x linuxdeploy-plugin-appimage
export LDAI_OUTPUT=neovide.AppImage
export LDAI_UPDATE_INFORMATION="gh-releases-zsync|neovide|neovide|latest|neovide.AppImage.zsync"
./linuxdeploy \
--executable=neovide \
--desktop-file=../../assets/neovide.desktop \
--appdir=AppDir \
--icon-file=../../assets/neovide.svg \
--output=appimage
echo "ARTIFACT=neovide-linux-x86_64.tar.gz" >> $GITHUB_ENV
echo "ARTIFACT2=neovide.AppImage" >> $GITHUB_ENV
echo "ARTIFACT3=neovide.AppImage.zsync" >> $GITHUB_ENV
fi
- uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT }}
path: target/release/${{ env.ARTIFACT }}
- if: env.ARTIFACT2
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT2 }}
path: target/release/${{ env.ARTIFACT2 }}
- if: env.ARTIFACT3
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT3 }}
path: target/release/${{ env.ARTIFACT3 }}