diff --git a/.github/scripts/verify-build.sh b/.github/scripts/verify-build.sh new file mode 100755 index 0000000..1893ee6 --- /dev/null +++ b/.github/scripts/verify-build.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# Check if build output at dist is uptodate or not + +# Check files updated in working dir +git status dist -s + +# Raise error if more than 1 files changed in working dir +if [[ ! -z $(git status dist -s) ]]; then + echo "Build at dist is outdated. Update build, push and try again." + exit 1 +fi diff --git a/.github/workflows/feature-branch.yaml b/.github/workflows/feature-branch.yaml new file mode 100644 index 0000000..3c42ad5 --- /dev/null +++ b/.github/workflows/feature-branch.yaml @@ -0,0 +1,28 @@ +name: Feature Branch + +on: + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + name: Build + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: 12 + + - name: Install dependencies + run: npm install + + - name: Build package + run: npm run build + + - name: Verify build + run: .github/scripts/verify-build.sh