diff --git a/.github/workflows/test-and-lint-backend.yml b/.github/workflows/backend.yml similarity index 100% rename from .github/workflows/test-and-lint-backend.yml rename to .github/workflows/backend.yml diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..b60780f --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,26 @@ +name: Build Docker container + +on: + # Too expensive to run on ever push. Only run on PR. + pull_request: + branches: [ "main" ] + +jobs: + docker: + runs-on: ubuntu-latest + steps: + - name: git checkout + uses: actions/checkout@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.11' + - name: Build container + uses: actions/checkout@v3 + - working-directory: ./backend + run: | + docker compose build diff --git a/.github/workflows/frontend.yml b/.github/workflows/frontend.yml new file mode 100644 index 0000000..25b8faf --- /dev/null +++ b/.github/workflows/frontend.yml @@ -0,0 +1,24 @@ +name: Test and lint frontend + +on: + push: + branches: ['**'] + pull_request: + branches: [ "main" ] + +jobs: + run-npm: + runs-on: ubuntu-latest + steps: + - name: git checkout + uses: actions/checkout@v3 + - name: set up node + uses: actions/setup-node@v3 + with: + node-version: '18.17.1' + - name: npm install + uses: actions/checkout@v3 + - working-directory: ./frontend-ts + run: | + npm ci + npx eslint diff --git a/.github/workflows/bandit.yml b/.github/workflows/security.yml similarity index 75% rename from .github/workflows/bandit.yml rename to .github/workflows/security.yml index b88a60d..bf7e29c 100644 --- a/.github/workflows/bandit.yml +++ b/.github/workflows/security.yml @@ -57,3 +57,20 @@ jobs: path: ./ base: ${{ github.event.repository.default_branch }} head: HEAD + + pip_audit: + name: Pip Audit + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + - working-directory: + run: | + python -m pip install --upgrade pip + pip3 install poetry + poetry config virtualenvs.create false + poetry shell + poetry install + - uses: pypa/gh-action-pip-audit@v1.0.8 + with: + virtual-environment: .venv diff --git a/.github/workflows/truffle.yml b/.github/workflows/truffle.yml deleted file mode 100644 index 55e3494..0000000 --- a/.github/workflows/truffle.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Truffle Key Scan -on: [push] -jobs: - Scan: - runs-on: ubuntu-latest - steps: - - name: Checkout COde - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - name: - uses: trufflesecurity/trufflehog@main - with: - path: ./ - base: ${{ github.event.repository.default_branch }} - head: HEAD - extra_args: --debug diff --git a/frontend-ts/package-lock.json b/frontend-ts/package-lock.json index a8a2359..ab109d3 100644 --- a/frontend-ts/package-lock.json +++ b/frontend-ts/package-lock.json @@ -8,7 +8,6 @@ "name": "frontend-ts", "version": "0.0.0", "dependencies": { - "@faker-js/faker": "^8.1.0", "@hookform/resolvers": "^3.3.1", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.4", @@ -72,6 +71,7 @@ "zod": "^3.22.2" }, "devDependencies": { + "@faker-js/faker": "^8.2.0", "@types/node": "^20.6.0", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", @@ -79,7 +79,7 @@ "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.0.3", "autoprefixer": "^10.4.15", - "eslint": "^8.45.0", + "eslint": "^8.52.0", "postcss": "^8.4.29", "tailwindcss": "^3.3.3", "typescript": "^5.0.2", @@ -2578,17 +2578,18 @@ } }, "node_modules/@eslint/js": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.51.0.tgz", - "integrity": "sha512-HxjQ8Qn+4SI3/AFv6sOrDB+g6PpUTDwSJiQqOrnneEk8L71161srI9gjzzZvYVbzHiVg/BvcH95+cK/zfIt4pg==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", + "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, "node_modules/@faker-js/faker": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.1.0.tgz", - "integrity": "sha512-38DT60rumHfBYynif3lmtxMqMqmsOQIxQgEuPZxCk2yUYN0eqWpTACgxi0VpidvsJB8CRxCpvP7B3anK85FjtQ==", + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-8.2.0.tgz", + "integrity": "sha512-VacmzZqVxdWdf9y64lDOMZNDMM/FQdtM9IsaOPKOm2suYwEatb8VkdHqOzXcDnZbk7YDE2BmsJmy/2Hmkn563g==", + "dev": true, "funding": [ { "type": "opencollective", @@ -2658,11 +2659,11 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.11.11", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.11.tgz", - "integrity": "sha512-N2brEuAadi0CcdeMXUkhbZB84eskAc8MEX1By6qEchoVywSgXPIjou4rYsl0V3Hj0ZnuGycGCjdNgockbzeWNA==", + "version": "0.11.13", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", + "integrity": "sha512-JSBDMiDKSzQVngfRjOdFXgFfklaXI4K9nLF49Auh21lmBWRLIK3+xTErTWD4KU54pb6coM6ESE7Awz/FNU3zgQ==", "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", + "@humanwhocodes/object-schema": "^2.0.1", "debug": "^4.1.1", "minimatch": "^3.0.5" }, @@ -2683,9 +2684,9 @@ } }, "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==" + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-2.0.1.tgz", + "integrity": "sha512-dvuCeX5fC9dXgJn9t+X5atfmgQAzUOWqS1254Gh0m6i8wKd10ebXkfNKiRK+1GWi/yTvvLDHpoxLr0xxxeslWw==" }, "node_modules/@jest/create-cache-key-function": { "version": "29.7.0", @@ -5929,6 +5930,11 @@ "react-dom": ">=18.0.0" } }, + "node_modules/@ungap/structured-clone": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", + "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==" + }, "node_modules/@vitejs/plugin-react": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@vitejs/plugin-react/-/plugin-react-4.1.0.tgz", @@ -8032,17 +8038,18 @@ } }, "node_modules/eslint": { - "version": "8.51.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.51.0.tgz", - "integrity": "sha512-2WuxRZBrlwnXi+/vFSJyjMqrNjtJqiasMzehF0shoLaW7DzS3/9Yvrmq5JiT66+pNjiX4UBnLDiKHcWAr/OInA==", + "version": "8.52.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", + "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.51.0", - "@humanwhocodes/config-array": "^0.11.11", + "@eslint/js": "8.52.0", + "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", + "@ungap/structured-clone": "^1.2.0", "ajv": "^6.12.4", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", diff --git a/frontend-ts/package.json b/frontend-ts/package.json index 85fe6cb..9c2c68d 100644 --- a/frontend-ts/package.json +++ b/frontend-ts/package.json @@ -10,7 +10,6 @@ "preview": "vite preview" }, "dependencies": { - "@faker-js/faker": "^8.1.0", "@hookform/resolvers": "^3.3.1", "@radix-ui/react-accordion": "^1.1.2", "@radix-ui/react-alert-dialog": "^1.0.4", @@ -74,6 +73,7 @@ "zod": "^3.22.2" }, "devDependencies": { + "@faker-js/faker": "^8.2.0", "@types/node": "^20.6.0", "@types/react": "^18.2.15", "@types/react-dom": "^18.2.7", @@ -81,7 +81,7 @@ "@typescript-eslint/parser": "^6.0.0", "@vitejs/plugin-react": "^4.0.3", "autoprefixer": "^10.4.15", - "eslint": "^8.45.0", + "eslint": "^8.52.0", "postcss": "^8.4.29", "tailwindcss": "^3.3.3", "typescript": "^5.0.2", diff --git a/makefile b/makefile index 3d0520a..f2df437 100644 --- a/makefile +++ b/makefile @@ -20,6 +20,26 @@ ## ========================== PROCESSES =============================== +.PHONY frontend-lint: +frontend-lint: + echo s + +.PHONY frontend-test: +frontend-test: + echo s + +.PHONY backend-lint: +backend-lint: + echo s + +.PHONY backend-test: +backend-test: + echo s + +.PHONY build-docker: +build-docker: + docker compose up --build + .PHONY build: ## Build the project from scratch build: ./scripts/build.sh