Skip to content

Develop #45

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

Open
wants to merge 7 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
34 changes: 34 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Name of workflow
name: Lint workflow

# Trigger workflow on all pull requests
on:
pull_request:
branches:
- develop
- staging

# Jobs to carry out
jobs:
test:
# Operating system to run job on
runs-on: ubuntu-latest

# Steps in job
steps:
# Get code from repo
- name: Checkout code
uses: actions/checkout@v1

- name: Use Node.js 21.x
uses: actions/setup-node@v1
with:
node-version: 21.x

# Install dependencies
- name: 🧰 Install Deps
run: npm install

# Run lint
- name: Run Lint
run: npm run lint
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ GitHub Actions is a great solution to this problem. For example, you could creat

## Initial Project Setup

TODO: this definitely doesn't work
To begin, start by forking the following repository [GitHub Actions Demo](https://github.com/coding-boot-camp/github-actions-demo). Once you have forked this repository you should then clone the forked repository to your local machine.

## Create the Workflow
Expand Down
94 changes: 46 additions & 48 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
"dev": "vite --port 3000",
"build": "tsc && vite build",
"lint": "eslint src --ext js,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"eslint": "eslint src",
"preview": "vite preview",
"eslint": "eslint src",
"test": "vitest"
},
"dependencies": {
"lint": "^1.1.2",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
Expand All @@ -27,7 +28,7 @@
"eslint": "^8.45.0",
"eslint-plugin-react-hooks": "^4.6.0",
"eslint-plugin-react-refresh": "^0.4.3",
"happy-dom": "^14.12.3",
"happy-dom": "^17.4.4",
"pretty": "^2.0.0",
"typescript": "^5.0.2",
"vite": "^4.4.5",
Expand Down
1 change: 1 addition & 0 deletions src/components/Calculator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ export default function Calculator() {

return (
<div className="calculator">
<h2>Simple Calculator</h2>
<p>
<input
type="text"
Expand Down
2 changes: 1 addition & 1 deletion src/tests/__snapshots__/Calculator.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`Calculator > should match snapshot 1`] = `
"<h2>Simple Calculator</h2>
<p><input type="text" id="value" value="0" name="value"></p><button class="btn btn-primary" type="button"> Add </button>
<p><input type="text" id="value" name="value" value="0"></p><button class="btn btn-primary" type="button"> Add </button>
<p class="card-text">Total: 0</p>
<p class="card-text">Previous Total: 0</p>"
`;