Skip to content

Commit

Permalink
Merge pull request #12 from BFlorian91/dev
Browse files Browse the repository at this point in the history
Fix CI, and some errors in the test environment
  • Loading branch information
FlorianBx authored Dec 15, 2023
2 parents 815b8ad + 6ebaf4b commit 1e68d64
Show file tree
Hide file tree
Showing 80 changed files with 2,703 additions and 24,303 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml → .github/workflows/basic-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ jobs:
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: "16" # Spécifiez la version de Node.js que vous utilisez
node-version: "16"

- name: Install Dependencies
run: npm install

- name: Run Linter
run: npm run lint

- name: Run Unit Tests
run: npm run test
# - name: Run Unit Tests
# run: npm run test

- name: Create Pull Request
if: github.event_name == 'push' && github.ref == 'refs/heads/feature/**'
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/firebase-ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Firebase Emulator Testing
on: [push, pull_request]
jobs:
emulator_test:
name: Run all the tests using Firebase Emulator Suite
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: "20"

- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: "oracle"
java-version: "17"

- name: Install Firebase Emulator Suite
run: npm install -g firebase-tools

- name: Install depedencies
run: npm install
working-directory: src/

- name: Run all the tests
working-directory: src/
run: firebase emulators:exec --project code-vault-dd8d8 'npm run test'
env:
GCloud_Project: fb-visuals
VITE_API_KEY: ${{ secrets.VITE_API_KEY }}
VITE_AUTH_DOMAIN: ${{ secrets.VITE_AUTH_DOMAIN }}
VITE_PROJECT_ID: ${{ secrets.VITE_PROJECT_ID }}
VITE_STORAGE_BUCKET: ${{ secrets.VITE_STORAGE_BUCKET }}
VITE_MESSAGING_SENDER_ID: ${{ secrets.VITE_MESSAGING_SENDER_ID }}
VITE_APP_ID: ${{ secrets.VITE_APP_ID }}
VITE_MEASUREMENT_ID: ${{ secrets.VITE_MEASUREMENT_ID }}
FIREBASE_TYPE: ${{ secrets.FIREBASE_TYPE }}
FIREBASE_PROJECT_ID: ${{ secrets.FIREBASE_PROJECT_ID }}
FIREBASE_PRIVATE_KEY_ID: ${{ secrets.FIREBASE_PRIVATE_KEY_ID }}
FIREBASE_PRIVATE_KEY: ${{ secrets.FIREBASE_PRIVATE_KEY }}
FIREBASE_CLIENT_EMAIL: ${{ secrets.FIREBASE_CLIENT_EMAIL }}
FIREBASE_CLIENT_ID: ${{ secrets.FIREBASE_CLIENT_ID }}
FIREBASE_AUTH_URI: ${{ secrets.FIREBASE_AUTH_URI }}
FIREBASE_TOKEN_URI: ${{ secrets.FIREBASE_TOKEN_URI }}
FIREBASE_AUTH_PROVIDER_X509_CERT_URL: ${{ secrets.FIREBASE_AUTH_PROVIDER_X509_CERT_URL }}
FIREBASE_CLIENT_X509_CERT_URL: ${{ secrets.FIREBASE_CLIENT_X509_CERT_URL }}
FIREBASE_UNIVERSE_DOMAIN: ${{ secrets.FIREBASE_UNIVERSE_DOMAIN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ dist-ssr
*.local
coverage
!coverage/coverage-final.json
firestore.rules
pnpm-lock.yaml
package-lock.json

# Editor directories and files
.vscode/*
Expand Down
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

pnpm test && pnpm lint
pnpm test:fe && pnpm lint
14 changes: 9 additions & 5 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
{
"singleQuote": false,
"semi": true,
"tabWidth": 2,
"trailingComma": "all"
}
"singleQuote": false,
"useTabs": true,
"semi": true,
"tabWidth": 2,
"trailingComma": "all",
"printWidth": 80,
"htmlWhitespaceSensitivity": "ignore"
}

17 changes: 16 additions & 1 deletion firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,20 @@
"npm --prefix \"$RESOURCE_DIR\" run build"
]
}
]
],
"emulators": {
"auth": {
"port": 9099
},
"functions": {
"port": 5001
},
"firestore": {
"port": 8080
},
"ui": {
"enabled": true
},
"singleProjectMode": true
}
}
58 changes: 28 additions & 30 deletions functions/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,30 @@
module.exports = {
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: [
"@typescript-eslint",
"import",
],
rules: {
"quotes": ["error", "double"],
"import/no-unresolved": 0,
"indent": ["error", 2],
},
root: true,
env: {
es6: true,
node: true,
},
extends: [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:import/typescript",
"google",
"plugin:@typescript-eslint/recommended",
],
parser: "@typescript-eslint/parser",
parserOptions: {
project: ["tsconfig.json", "tsconfig.dev.json"],
sourceType: "module",
},
ignorePatterns: [
"/lib/**/*", // Ignore built files.
],
plugins: ["@typescript-eslint", "import"],
rules: {
"quotes": ["error", "double"],
"indent": ["error", "tab"],
"import/no-unresolved": 0,
"no-tabs": 0,
},
};
15 changes: 0 additions & 15 deletions functions/index.ts

This file was deleted.

Loading

0 comments on commit 1e68d64

Please sign in to comment.