-
Notifications
You must be signed in to change notification settings - Fork 257
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
Improve vitest config and add GitHub action for lint + testing #22
Closed
Closed
Changes from all commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
463cafc
Add github actions for lint and test. Fix up tests to always use vitest
nichochar aad147c
Further configuration updates
nichochar cc21998
Put the github workflows in the root directory
nichochar f196cb5
Improve workflow comment
nichochar 0cd5553
Switch back to path.resolve mechanism
nichochar 82e500d
Add base
nichochar 87c5d2b
Cleanup frontend tests
nichochar ccfd238
Split into front and backend. Run type checker
benjreinhart 70a8f2f
Update commands and config
benjreinhart 669f7a6
Change commands
benjreinhart 7201d74
Use command
benjreinhart f8b80c0
One last try to respect vitest globals
benjreinhart 948b60e
Changes
benjreinhart e2ceb4f
Try removing this
benjreinhart 17679b4
Remove vitest
benjreinhart d5f3935
Try removing postcss
benjreinhart 4d54a9f
Fix test
benjreinhart 77b5d4c
Add posto css back
benjreinhart 42b5653
Try another extension
benjreinhart 1f4ed6f
Fix tests
nichochar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# This workflow will do a clean installation of node dependencies, cache/restore them, build the source code and run tests. | ||
# For now we only run against node 22.x, but can easily add more node versions should we decide to support them. | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-nodejs | ||
|
||
name: Node.js CI | ||
|
||
on: | ||
push: | ||
branches: ['main'] | ||
pull_request: | ||
branches: ['main'] | ||
|
||
jobs: | ||
frontend: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [22.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install frontend dependencies | ||
run: npm ci | ||
- name: Lint frontend | ||
run: npm run lint | ||
- name: Check code format (also checks backend code) | ||
run: npm run check:format | ||
- name: Check that the frontend can successfully build (runs type checking) | ||
run: npm run build | ||
|
||
backend: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/ | ||
node-version: [22.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'npm' | ||
- name: Install server dependencies | ||
working-directory: ./server | ||
run: npm ci | ||
- name: Lint backend | ||
working-directory: ./server | ||
run: npm run check | ||
- name: Run backend tests | ||
working-directory: ./server | ||
run: npm run ci:test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should re-add this. Idk that it should affect anything here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should readd this as
process.env.MY_ENV_VAR
.I don't know why the vite stuff and vite namespace is used for regular operating system environment variables. The vite specific stuff is for building frontend apps that are compiled for the browser.