Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Add workflow file for pull requests #59

Merged
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This workflow will run all checks required for a PR to be merged.

name: Build and Test ci

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build-and-test:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/[email protected]

- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: "18.16.1"
registry-url: "https://registry.npmjs.org"

- name: Install dependencies
run: yarn

- name: Check linting and formatting
run: |
if yarn lint && yarn format --check; then
echo "Linting and formatting checks passed."
else
echo "Linting or formatting checks failed. Please fix the issues."
exit 1
fi

- name: Create and build generated code
abhishek-exists marked this conversation as resolved.
Show resolved Hide resolved
run: |
npx create-puck-app test-ci-app
cd test-ci-app
yarn build
abhishek-exists marked this conversation as resolved.
Show resolved Hide resolved

- name: Check for build failures
run: |
if [ $? -ne 0 ]; then
echo "Build failed. Please fix the issues."
exit 1
fi
Loading