Skip to content

Commit

Permalink
Merge pull request #52 from CMU-313/flow
Browse files Browse the repository at this point in the history
Integration and Testing of Flow Static Analysis Tool
  • Loading branch information
karengc27 authored Oct 30, 2024
2 parents d6195d6 + a007b3c commit 56f67b0
Show file tree
Hide file tree
Showing 5 changed files with 621 additions and 1 deletion.
30 changes: 30 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[ignore]
.*/node_modules/.*
.*/build/.*
.*/public/.*
.*/lib/.*
.*/coverage/.*
.*/tests/.*
.*/types/.*
.*/logs/.*
.*/install/.*
.*/loader.js
.*/require-main.js
.*/webpack.installer.js
.*/commitlint.config.js
.*/app.js
.*/Gruntfile.js

[include]
./src

[libs]

[lints]
untyped-type-import=error
internal-type=error
deprecated-type-bool=error

[options]

[strict]
81 changes: 81 additions & 0 deletions .github/workflows/flow-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Flow Tests

on:
pull_request:
branches:
- f24
workflow_call: # Usually called from deploy

defaults:
run:
shell: bash

permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code

jobs:
test:
runs-on: ubuntu-latest
env:
TEST_ENV: 'production'

services:
redis:
image: 'redis:7.2.4'
# Set health checks to wait until redis has started
options: >-
--health-cmd "redis-cli ping"
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
# Maps port 6379 on service container to the host
- 6379:6379

steps:
- uses: actions/checkout@v4

- run: cp install/package.json package.json

- name: Install Node
uses: actions/setup-node@v4
with:
node-version: 20

- name: NPM Install
uses: bahmutov/npm-install@v1
with:
useLockFile: false

- name: Setup for Redis
env:
SETUP: >-
{
"url": "http://127.0.0.1:4567/forum",
"secret": "abcdef",
"admin:username": "admin",
"admin:email": "test@example.org",
"admin:password": "hAN3Eg8W",
"admin:password:confirm": "hAN3Eg8W",
"database": "redis",
"redis:host": "127.0.0.1",
"redis:port": 6379,
"redis:password": "",
"redis:database": 0
}
CI: >-
{
"host": "127.0.0.1",
"database": 1,
"port": 6379
}
run: |
node app --setup="${SETUP}" --ci="${CI}"
- name: Install Flow
run: npm install --save-dev flow-bin

- name: Run Flow
run: npx flow check --all
Loading

0 comments on commit 56f67b0

Please sign in to comment.