Skip to content

Commit

Permalink
Separate CI workflows to isolate test/build/release concerns
Browse files Browse the repository at this point in the history
  • Loading branch information
alerque committed Jun 17, 2021
1 parent cb42e59 commit a9478f7
Show file tree
Hide file tree
Showing 4 changed files with 94 additions and 62 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Build

on: [push, pull_request]

jobs:

standalone:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Configure standalone script
run: |
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
echo VERSION=$(cat .version) >> $GITHUB_ENV
- name: Post standalone script artifact
uses: actions/upload-artifact@v2
with:
name: standalone-deployment-${{ env.VERSION }}
path: vcsh-standalone.sh

source-dist:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Install build dependencies
run: |
sudo apt install -y ronn
- name: Install perl test dependencies
uses: perl-actions/[email protected]
with:
install: |
Shell::Command
Test::Most
- name: Configure
run: |
./bootstrap.sh
./configure
- name: Run tests
run: |
make check
- name: Build source package
run: |
make dist
echo VERSION=$(cat .version) >> $GITHUB_ENV
- name: Post build artifacts
uses: actions/upload-artifact@v2
with:
name: vcsh-${{ env.VERSION }}
path: vcsh-${{ env.VERSION }}.zip
4 changes: 4 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
name: Lint

on: [push, pull_request]

jobs:

editor-config:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Lint code style
uses: editorconfig-checker/[email protected]

shellcheck:
runs-on: ubuntu-latest
steps:
Expand Down
54 changes: 23 additions & 31 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,60 +7,52 @@ on:

jobs:

standalone:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure standalone script
run: |
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Upload standalone script artifact
uses: actions/upload-artifact@v2
with:
name: standalone-deployment
path: vcsh-standalone.sh

ghrelase:
runs-on: ubuntu-latest
needs: [ standalone ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install ronn
- name: Install build dependencies
run: |
sudo apt update
sudo apt install -y ronn
- name: Configure
run: |
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
echo "${GITHUB_REF#refs/*/v}" > .tarball-version
./bootstrap.sh
./configure
- name: Build source package
run: |
make dist
- name: Check source package behaviour
run: |
make distcheck
- name: Make sure changelog was updated
run: |
make changelog-HEAD
grep -F "* Release ${{ env.VERSION }}" changelog-HEAD
- name: Download standalone script artifact
uses: actions/download-artifact@v2
with:
name: standalone-deployment
- name: Build source package
run: |
make dist
- name: Publish Release
uses: softprops/action-gh-release@v1
with:
body_path: changelog-HEAD
files: |
vcsh-${{ env.VERSION }}.zip
vcsh-${{ env.VERSION }}.tar.xz
vcsh-standalone.sh
env:
GITHUB_TOKEN: ${{ github.token }}

deploy-standalone:
runs-on: ubuntu-latest
needs: [ ghrelease ]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Configure standalone script
run: |
echo "VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Add standalone deployment to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: vcsh-standalone.sh
tag: ${{ github.ref }}
35 changes: 4 additions & 31 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,6 @@ on: [push, pull_request]

jobs:

standalone:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Configure standalone script
run: |
./bootstrap.sh
./configure --with-standalone --bindir=/
make DESTDIR=. install-exec
- name: Post standalone script artifact
uses: actions/upload-artifact@v2
with:
name: standalone-deployment
path: vcsh-standalone.sh

test:
runs-on: ubuntu-latest
steps:
Expand All @@ -35,9 +14,9 @@ jobs:
- name: Fetch tags
run: |
git fetch --prune --tags ||:
- name: Install dependencies
- name: Install build dependencies
run: |
sudo apt install ronn
sudo apt install -y ronn
- name: Install perl test dependencies
uses: perl-actions/[email protected]
with:
Expand All @@ -51,12 +30,6 @@ jobs:
- name: Run tests
run: |
make check
- name: Build source package
- name: Run full cycle packaging check
run: |
make dist
echo VERSION=$(cat .version) >> $GITHUB_ENV
- name: Post build artifacts
uses: actions/upload-artifact@v2
with:
name: vcsh-${{ env.VERSION }}
path: vcsh-${{ env.VERSION }}.zip
make distcheck

0 comments on commit a9478f7

Please sign in to comment.