Skip to content

Commit

Permalink
Merge pull request #2632 from LiteFarmOrg/integration
Browse files Browse the repository at this point in the history
V3.3.0
  • Loading branch information
kikemarquez8 authored Apr 17, 2023
2 parents bfb58a2 + 88cb783 commit 690e290
Show file tree
Hide file tree
Showing 1,197 changed files with 126,488 additions and 57,314 deletions.
32 changes: 32 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
**Description**

Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. List any dependencies that are required for this change.

Jira link:

**Type of change**

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] This change requires a documentation update

**How Has This Been Tested?**

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration

- [ ] Passes test case
- [ ] UI components visually reviewed on desktop view
- [ ] UI components visually reviewed on mobile view
- [ ] Other (please explain)

**Checklist:**

- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] The precommit and linting ran successfully
- [ ] I have added or updated language tags for text that's part of the UI
- [ ] I have added "MISSING" for all new language tags to languages I don't speak
- [ ] I have added [the GNU General Public License](https://lite-farm.atlassian.net/l/cp/BT0Dd7WW) to all new files
4 changes: 2 additions & 2 deletions .github/workflows/automated_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
automated_tests:
runs-on: ubuntu-20.04
container: node:16.13.2
container: node:16.15.0
services:
postgres:
image: postgres:13
Expand Down Expand Up @@ -38,7 +38,7 @@ jobs:
uses: actions/checkout@v3
# Install all the dependencies
- name: Install dependencies
run: cd packages/api && npm ci
run: cd packages/api && npm ci && cd ../shared && npm ci
# Run migrations on the database
- name: Setup database
run: cd packages/api && npm run migrate:pipeline:db
Expand Down
18 changes: 18 additions & 0 deletions .github/workflows/beta-export-deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Beta-Export-Server-Deploy'
on:
push:
branches:
- integration

jobs:
deploy:
name: Deploy on beta export server
runs-on: ubuntu-20.04
steps:
- name: Deploy beta export server over SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.BETA_EXPORT_SERVER_HOST }}
username: ${{ secrets.BETA_EXPORT_SERVER_USER }}
key: ${{ secrets.BETA_EXPORT_SERVER_KEY }}
script: ${{ secrets.BETA_EXPORT_SERVER_SCRIPT }}
104 changes: 104 additions & 0 deletions .github/workflows/cypress_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Run cypress happy path test

on:
pull_request:
branches:
- integration

jobs:
build:
runs-on: ubuntu-20.04
timeout-minutes: 30
env:
JWT_INVITE_SECRET: ${{secrets.JWT_INVITE_SECRET}}
JWT_RESET_SECRET: ${{secrets.JWT_RESET_SECRET}}
JWT_SCHEDULER_SECRET: ${{secrets.JWT_SCHEDULER_SECRET}}
JWT_SECRET: ${{secrets.JWT_SECRET}}
TEST_USER: ${{secrets.TEST_USER}}
TEST_USER_ID: ${{secrets.TEST_USER_ID}}
DEV_DATABASE_HOST: localhost
DEV_DATABASE: pg-litefarm
DEV_DATABASE_USER: postgres
DEV_DATABASE_PASSWORD: postgres
GOOGLE_API_KEY: ${{secrets.VITE_GOOGLE_MAPS_API_KEY}}
VITE_GOOGLE_MAPS_API_KEY: ${{secrets.VITE_GOOGLE_MAPS_API_KEY}}
VITE_WEATHER_API_KEY: ${{secrets.VITE_WEATHER_API_KEY}}
NODE_ENV: development

strategy:
matrix:
node-version: [16.15.0]

steps:
- uses: ikalnytskyi/action-setup-postgres@v3
with:
username: ${{env.DEV_DATABASE_USER}}
password: ${{env.DEV_DATABASE_PASSWORD}}
database: ${{env.DEV_DATABASE}}
port: 5432

- uses: actions/checkout@v2

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

- name: Run API in background
working-directory: packages/api
run: |
npm ci && cd ../shared && npm ci
cd ../api && npm run migrate:dev:db
npm run start &
env:
PORT: 5000

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: latest

- name: Run and test app
env:
VITE_WEATHER_API_KEY: ${{secrets.VITE_WEATHER_API_KEY}}
VITE_ENV: development
VITE_GOOGLE_OAUTH_CLIENT_ID: ${{secrets.VITE_GOOGLE_OAUTH_CLIENT_ID}}
VITE_DO_BUCKET_NAME: litefarm
NODE_ENV: development
VITE_API_URL: http://localhost:5000
CYPRESS_RECORD_KEY: "2630f414-4914-48b0-907d-aa3a9cc6a30b"
uses: cypress-io/[email protected]
with:
working-directory: packages/webapp
install-command: pnpm install --config.auto-install-peers=true --no-frozen-lockfile --force
install: true
start: pnpm dev
wait-on: 'http://localhost:3000'
wait-on-timeout: 120
headed: true
browser: chrome
record: true
parallel: true
group: 'UI - Chrome'
spec: cypress/e2e/happyPath.spec.js

- name: set code coverage badge
run: npx -p check-code-coverage update-badge --from '${GITHUB_WORKSPACE}/packages/webapp/coverage/coverage-summary.json'
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Archive code coverage results
uses: actions/upload-artifact@v3
continue-on-error: true
with:
name: code-coverage-report
working-directory: packages/webapp
path: coverage/coverage-summary.json

- name: Set code coverage commit status
continue-on-error: true
working-directory: packages/webapp
run: npx set-gh-status
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
GH_SHA: ${{ github.event.after }}
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: 'Deploy'
on:
workflow_dispatch:

push:
branches:
- integration

concurrency: beta-deploy

jobs:
deploy:
runs-on: ubuntu-20.04
steps:
- name: Deploy over SSH
uses: appleboy/[email protected]
with:
host: ${{ secrets.BETA_SSH_HOST }}
username: ${{ secrets.BETA_SSH_USER }}
passphrase: ${{ secrets.BETA_SSH_PASS }}
key: ${{ secrets.BETA_SSH_KEY }}
command_timeout: 20m
script: ${{ secrets.DEPLOYMENT_SCRIPT }}
18 changes: 18 additions & 0 deletions .github/workflows/rollout.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: 'Roll out'
on:
workflow_dispatch:
push:
branches:
- integration
jobs:
rollout:
runs-on: ubuntu-20.04
steps:
- name: Docker deploy
uses: TapTap21/[email protected]
with:
remote_docker_host: [email protected]
ssh_private_key: ${{ secrets.PRIVATE_KEY }}
ssh_public_key: ${{ secrets.PUBLIC_KEY }}
stack_file_name: docker-compose.beta.yml
args: up --build -d
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ packages/webapp/.env
packages/webapp/cypress/videos
packages/webapp/cypress/screenshots
packages/webapp/.nyc_output
packages/webapp/.nyc_output/out.json
packages/webapp/cypress.env.json
.vscode
.DS_Store
.env
packages/webapp/cypress/integration/1-getting-started
packages/webapp/cypress/integration/2-advanced-examples
packages/webapp/cypress/integration/2-advanced-examples
ngrok/ngrok.yml
Loading

0 comments on commit 690e290

Please sign in to comment.