Skip to content

Commit

Permalink
added ci scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
husixu1 committed Mar 25, 2023
1 parent 04cd70b commit a0dd59b
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/release-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Release checks

on:
push:
tags:
- 'v*'

jobs:
myjob:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master'
steps:
- name: Verify version number
run: |
TAG="$(git describe --abbrev=0 --tags)"
VERSION="$(./bpt.sh -v)"
if [[ "$TAG" != "$VERSION" ]]; then
echo "ERROR: Version mismatch between Git tag ($TAG) and bpt ($VERSION)"
exit 1
fi
26 changes: 26 additions & 0 deletions .github/workflows/test-verify.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Test bpt

on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install dependencies
run: |
curl -k -sSL https://raw.githubusercontent.com/pgrange/bash_unit/v2.1.0/install.sh | bash
[[ $(sha256sum bash_unit | cut -d " " -f1) == dfb4d50cef03f4d49f083d4945352793499cd5ba1e2cc2482d6f80d510d20374 ]] || exit 1
curl -k -sSL https://github.com/mvdan/sh/releases/download/v3.6.0/shfmt_v3.6.0_linux_amd64 -o shfmt
[[ $(sha256sum shfmt | cut -d " " -f1) == 5741a02a641de7e56b8da170e71a97e58050d66a3cf485fb268d6a5a8bb74afb ]] || exit 1
chmod +x shfmt
- name: Run Tests
run: ./bash_unit -f tap test/test-*

- name: Check script formatting
run: ./shfmt -d -i 4 bpt.sh

0 comments on commit a0dd59b

Please sign in to comment.