190 lines
5.3 KiB
YAML
190 lines
5.3 KiB
YAML
name: Build
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
branches:
|
|
- master
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
PythonLint:
|
|
runs-on: ubuntu-16.04
|
|
container: 'puremourning/vimspector:test'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: 'Insatll requirements'
|
|
run: pip3 install --user -r dev_requirements.txt
|
|
- name: 'Run flake8'
|
|
run: '$HOME/.local/bin/flake8 python3/ *.py'
|
|
VimscriptLint:
|
|
runs-on: 'ubuntu-16.04'
|
|
container: 'puremourning/vimspector:test'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
- name: 'Install requirements'
|
|
run: pip3 install --user -r dev_requirements.txt
|
|
- name: 'Run vint'
|
|
run: $HOME/.local/bin/vint autoload/ compiler/ plugin/ tests/ syntax/
|
|
|
|
Linux:
|
|
runs-on: 'ubuntu-16.04'
|
|
container:
|
|
image: 'puremourning/vimspector:test'
|
|
options: --cap-add=SYS_PTRACE --security-opt seccomp=unconfined
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: |
|
|
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
|
|
go get -u github.com/go-delve/delve/cmd/dlv
|
|
name: 'Install Delve for Go'
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
key: v1-gadgets-${{ runner.os }}-${{ hashFiles( 'python3/vimspector/gadgets.py' ) }}
|
|
path: gadgets/linux/download
|
|
name: Cache gadgets
|
|
|
|
- run: vim --version
|
|
name: 'Print vim version information'
|
|
|
|
- run: |
|
|
eval $(/home/linuxbrew/.linuxbrew/bin/brew shellenv)
|
|
export GOPATH=$HOME/go
|
|
./run_tests --install --update --report messages --quiet
|
|
name: 'Run the tests'
|
|
id: run_tests
|
|
env:
|
|
VIMSPECTOR_MIMODE: gdb
|
|
|
|
- name: "Upload test logs"
|
|
uses: actions/upload-artifact@v2
|
|
if: failure()
|
|
with:
|
|
name: 'test-logs-${{ runner.os }}'
|
|
path: 'tests/logs/**/*'
|
|
|
|
- run: ./make_package linux ${{ github.run_id }}
|
|
name: 'Package'
|
|
|
|
# TODO: test the tarball
|
|
|
|
- name: "Upload package"
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: 'package-linux'
|
|
path: 'package/linux-${{ github.run_id }}.tar.gz'
|
|
|
|
# - name: Start SSH session if failed
|
|
# uses: luchihoratiu/debug-via-ssh@main
|
|
# if: failure()
|
|
# with:
|
|
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
|
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
|
|
|
MacOS:
|
|
runs-on: 'macos-10.15'
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
- run: |
|
|
brew update-reset
|
|
brew doctor || true
|
|
for p in python@3.8 tcl-tk llvm lua luajit love; do
|
|
brew install $p || brew outdated $p || brew upgrade $p
|
|
done
|
|
brew install --cask macvim
|
|
brew link --overwrite python@3.8
|
|
name: 'Install vim and deps'
|
|
|
|
- run: go get -u github.com/go-delve/delve/cmd/dlv
|
|
name: 'Install Delve for Go'
|
|
|
|
- uses: actions/cache@v2
|
|
with:
|
|
key: v1-gadgets-${{ runner.os }}-${{ hashFiles( 'python3/vimspector/gadgets.py' ) }}
|
|
path: gadgets/macos/download
|
|
name: Cache gadgets
|
|
|
|
- run: vim --version
|
|
name: 'Print vim version information'
|
|
|
|
- run: ./run_tests --install --update --report messages --quiet
|
|
name: 'Run the tests'
|
|
id: run_tests
|
|
env:
|
|
VIMSPECTOR_MIMODE: lldb
|
|
|
|
- name: "Upload test logs"
|
|
uses: actions/upload-artifact@v2
|
|
if: failure()
|
|
with:
|
|
name: 'test-logs-${{ runner.os }}'
|
|
path: 'tests/logs'
|
|
|
|
- run: ./make_package macos ${{ github.run_id }}
|
|
name: 'Package'
|
|
|
|
# TODO: test the tarball
|
|
|
|
- name: "Upload package"
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: 'package-macos'
|
|
path: 'package/macos-${{ github.run_id }}.tar.gz'
|
|
|
|
# - name: Start SSH session if failed
|
|
# uses: luchihoratiu/debug-via-ssh@main
|
|
# if: failure()
|
|
# with:
|
|
# NGROK_AUTH_TOKEN: ${{ secrets.NGROK_AUTH_TOKEN }}
|
|
# SSH_PASS: ${{ secrets.SSH_PASS }}
|
|
|
|
PublishRelease:
|
|
runs-on: 'ubuntu-16.04'
|
|
needs:
|
|
- Linux
|
|
- MacOS
|
|
if: github.ref == 'refs/heads/master'
|
|
steps:
|
|
- name: 'Download artifacts'
|
|
id: download_artifacts
|
|
uses: actions/download-artifact@v2
|
|
|
|
- name: 'Create Release'
|
|
id: create_release
|
|
uses: actions/create-release@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
tag_name: ${{ github.run_id }}
|
|
release_name: Build ${{ github.run_id }}
|
|
draft: false
|
|
prerelease: true
|
|
|
|
- name: 'Upload Linux Package'
|
|
id: upload-release-asset-linux
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ${{ steps.download_artifacts.outputs.download-path }}/package-linux/linux-${{ github.run_id }}.tar.gz
|
|
asset_name: vimspector-linux-${{ github.run_id }}.tar.gz
|
|
asset_content_type: application/gzip
|
|
|
|
- name: 'Upload MacOS Package'
|
|
id: upload-release-asset-macos
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
with:
|
|
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
|
asset_path: ${{ steps.download_artifacts.outputs.download-path }}/package-macos/macos-${{ github.run_id }}.tar.gz
|
|
asset_name: vimspector-macos-${{ github.run_id }}.tar.gz
|
|
asset_content_type: application/gzip
|