Skip to content

Commit

Permalink
Add GitHub Actions (#90)
Browse files Browse the repository at this point in the history
* Update bootstrap script
* Update submodules to latest upstream

Signed-off-by: Mike Detwiler <[email protected]>
  • Loading branch information
detwiler authored Dec 30, 2020
1 parent 8e7be4e commit e68e50d
Show file tree
Hide file tree
Showing 22 changed files with 467 additions and 247 deletions.
113 changes: 113 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
name: ci
on: [push]
jobs:

build-test:
name: Build and Test
runs-on: ubuntu-latest
container: ${{ matrix.image }}

strategy:
matrix:
include:
- image: alpine:latest
vim-ycm-owner: detwiler
vim-ycm-ref: llvm-10
- image: fedora:latest
vim-ycm-owner: ycm-core
vim-ycm-ref: master
- image: ubuntu:rolling
vim-ycm-owner: ycm-core
vim-ycm-ref: master

env:
USER: ${{ github.repository_owner }}
VIM_YCM_OWNER: ${{ matrix.vim-ycm-owner }}
VIM_YCM_REF: ${{ matrix.vim-ycm-ref }}
DEBIAN_FRONTEND: noninteractive

steps:
- name: Upgrade Packages
run: |
os_id=`sed -ne 's/^ID=//p' /etc/os-release`
case $os_id in
alpine) apk update && apk upgrade && apk add git;;
fedora) dnf -y upgrade && dnf -y install git-core which;;
ubuntu) apt-get -y update && apt-get -y upgrade && apt-get -y install git;;
esac
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install Prerequisites
run: build-aux/install-prereqs

- name: Bootstrap
run: ./bootstrap
env:
ENVCONF_BOOTSTRAP_INSTALL_REQS: true

- name: Configure
run: ./configure --prefix=$RUNNER_TEMP/.local --sysconfdir=$RUNNER_TEMP/.config

- name: Build
run: make

- name: Test
run: make distcheck

- name: Install
run: make install

- name: Integration Test
run: |
vim -es -u $RUNNER_TEMP/.config/vim/vimrc -i NONE -c PlugInstall -c qa
find $RUNNER_TEMP/.config/vim/plugged/YouCompleteMe -name 'ycm_core.so' | grep .
- name: Configure Version
run: echo "PROJECT_VERSION=`cat .version`" >>$GITHUB_ENV

- name: Upload Distribution Artifact
uses: actions/upload-artifact@v2
with:
name: distribution-tarball
path: |
envconf-${{ env.PROJECT_VERSION }}.tar.gz
.version
create-release:
name: Create Release
runs-on: ubuntu-latest
needs: build-test
if: startsWith(github.ref, 'refs/tags/v')

steps:
- name: Download Distribution Artifact
uses: actions/download-artifact@v2
with:
name: distribution-tarball

- name: Configure Version
run: echo "PROJECT_VERSION=`cat .version`" >>$GITHUB_ENV

- name: Create Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ env.PROJECT_VERSION }}
release_name: Release ${{ env.PROJECT_VERSION }}

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: envconf-${{ env.PROJECT_VERSION }}.tar.gz
asset_name: envconf-${{ env.PROJECT_VERSION }}.tar.gz
asset_content_type: application/gzip
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
[submodule "gnulib"]
path = .gnulib
url = https://github.com/coreutils/gnulib.git
branch = master
shallow = true
[submodule "quickhatch-autotools"]
path = .qh-at
url = https://github.com/quickhatch/quickhatch-autotools.git
branch = master
shallow = true
2 changes: 1 addition & 1 deletion .gnulib
Submodule .gnulib updated 7853 files
2 changes: 1 addition & 1 deletion .qh-at
3 changes: 2 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ DISTCLEANFILES = $(gvg_version) \
$(pkg_release)

EXTRA_DIST = $(gvg_version) \
m4/gnulib-cache.m4
m4/gnulib-cache.m4 \
README.md

AM_DISTCHECK_CONFIGURE_FLAGS = HOME=$(top_distdir)

Expand Down
1 change: 0 additions & 1 deletion README

This file was deleted.

4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[![ci](https://github.com/detwiler/envconf/workflows/ci/badge.svg)](https://github.com/detwiler/envconf/actions)

# envconf
Environment Configuration
Loading

0 comments on commit e68e50d

Please sign in to comment.