Skip to content

Commit

Permalink
Merge branch 'main' into feat/link-transfer-transactions-between-acco…
Browse files Browse the repository at this point in the history
…unts
  • Loading branch information
letehaha committed Jan 7, 2024
2 parents 9c51a46 + 374b4fa commit da0a8f2
Show file tree
Hide file tree
Showing 36 changed files with 2,275 additions and 2,276 deletions.
2 changes: 1 addition & 1 deletion .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ PORT=8100
HOST=127.0.0.1

# Dev env
VITE_APP_API_HTTP=http://206.81.20.28:8081
VITE_APP_API_HTTP=
# Local env (requires backend being locally up)
# VITE_APP_API_HTTP=http://127.0.0.1:3101
VITE_APP_API_VER=/api/v1
File renamed without changes.
2 changes: 1 addition & 1 deletion .github/actions/docker-build/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ runs:
- name: Make envfile
uses: SpicyPizza/create-envfile@v1
with:
envkey_VITE_APP_API_HTTP: http://${{ inputs.vps-host }}:8081
envkey_VITE_APP_API_HTTP: https://${{ inputs.vps-host }}
envkey_VITE_APP_API_VER: ${{ inputs.vue-app-api-ver }}
directory: ./
file_name: .env
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/prepare-local-env/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ runs:
run: echo "##[set-output name=NVMRC;]$(cat .nvmrc)"
id: nvm
- name: Use Node.js (.nvmrc)
uses: actions/setup-node@v2
uses: actions/setup-node@v4
with:
node-version: "${{ steps.nvm.outputs.NVMRC }}"
- name: Add hosts to /etc/hosts
Expand Down
88 changes: 52 additions & 36 deletions .github/workflows/check-source-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,42 +64,58 @@ jobs:
- name: Build source code
run: npm run build

integration-tests:
name: Integration testing
needs: prepare-dependencies
runs-on: ubuntu-latest
strategy:
matrix:
# Run tests in parallel
containers: [1, 2, 3]
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
- uses: ./.github/actions/prepare-local-env
- name: Run Cypress e2e tests
uses: cypress-io/github-action@v4
with:
start: npm run dev
wait-on: http://budget-tracker.com:8100
install: false
config-file: cypress.config.ts
browser: chrome
quiet: true
record: true
parallel: true
group: Cypress tests
env:
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# pass GitHub token to detect new build vs re-run build
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_URL: http://budget-tracker.com:8100
PORT: 8100
HOST: budget-tracker.com
VITE_APP_API_HTTP: http://${{ secrets.VPS_HOST }}:8081
VITE_APP_API_VER: ${{ secrets.VUE_APP_API_VER }}
# integration-tests:
# name: Integration testing
# needs: prepare-dependencies
# runs-on: ubuntu-latest
# Disabled for now because when running in parallel, GitHub setups different
# machines with different chrome-browsers installed. That causes Cypress errors
# When trying to run in the cypress Docker container, there's no access to "sudo"
# to patch hosts file
# strategy:
# # when one test fails, DO NOT cancel the other
# # containers, because this will kill Cypress processes
# # leaving Cypress Cloud hanging ...
# # https://github.com/cypress-io/github-action/issues/48
# fail-fast: false
# matrix:
# # Run tests in parallel
# containers: [1, 2, 3]
# container:
# # Using Docker container because of the issue with parallelization:
# # https://github.com/cypress-io/github-action/blob/master/README.md#parallel
# # see browsers tags here: https://hub.docker.com/r/cypress/browsers/tags
# image: cypress/browsers:node-20.9.0-chrome-118.0.5993.88-1-ff-118.0.2-edge-118.0.2088.46-1
# options: --user 1001
# steps:
# - name: Checkout repository and submodules
# uses: actions/checkout@v2
# with:
# submodules: recursive
# token: ${{ secrets.REPOSITORIES_ACCESS_TOKEN }}
# - uses: ./.github/actions/prepare-local-env
# - name: Run Cypress e2e tests
# uses: cypress-io/github-action@v6
# with:
# start: npm run dev
# wait-on: http://budget-tracker.com:8100
# install: false
# config-file: cypress.config.ts
# browser: chrome
# quiet: true
# record: true
# # parallel: true
# group: Cypress tests
# env:
# CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
# # Recommended: pass the GitHub token lets this action correctly
# # determine the unique run id necessary to re-run the checks
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# BASE_URL: http://budget-tracker.com:8100
# PORT: 8100
# HOST: budget-tracker.com
# VITE_APP_API_HTTP: https://${{ secrets.API_HOST_PROD }}
# VITE_APP_API_VER: ${{ secrets.VUE_APP_API_VER }}

docker-build:
name: Build source code using Docker
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/image-to-docker-hub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- id: docker-build
uses: ./.github/actions/docker-build
with:
vps-host: ${{ secrets.VPS_HOST }}
vps-host: ${{ secrets.API_HOST_PROD }}
vue-app-api-ver: ${{ secrets.VUE_APP_API_VER }}
docker-hub-username: ${{ secrets.DOCKER_HUB_USERNAME }}
docker-hub-access-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18.17.1
20.9.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18.17.1 as build-stage
FROM node:20.9.0 as build-stage
WORKDIR /app
COPY . .
RUN npm ci
Expand Down
2 changes: 1 addition & 1 deletion backend
Submodule backend updated 138 files
19 changes: 18 additions & 1 deletion cypress.config.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import 'dotenv/config';
import { defineConfig } from 'cypress';
import fs from 'fs'

export default defineConfig({
projectId: 'pzeubs',
Expand All @@ -14,11 +15,27 @@ export default defineConfig({

viewportWidth: 1280,
viewportHeight: 970,
videoUploadOnPasses: false,
screenshotOnRunFailure: true,
retries: 1,
video: true,
requestTimeout: 5000,
defaultCommandTimeout: 5000,
setupNodeEvents(on, config) {
on(
'after:spec',
(spec: Cypress.Spec, results: CypressCommandLine.RunResult) => {
if (results && results.video) {
// Do we have failures for any retry attempts?
const failures = results.tests.some((test) =>
test.attempts.some((attempt) => attempt.state === 'failed')
)
if (!failures) {
// delete the video if the spec passed and no tests retried
fs.unlinkSync(results.video)
}
}
}
)
},
},
});
Loading

0 comments on commit da0a8f2

Please sign in to comment.