Skip to content

Commit

Permalink
Merge branch 'master' into PRO-2111-Config_Changes
Browse files Browse the repository at this point in the history
  • Loading branch information
vignesha22 authored Feb 27, 2024
2 parents 02c8e98 + 75bc1a0 commit 361a8d8
Show file tree
Hide file tree
Showing 14 changed files with 842 additions and 101 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/check-package-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Check if package version is updated

on:
pull_request:
branches:
- master
jobs:
start:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup NodeJS
uses: "actions/setup-node@v3"
with:
node-version: 18.15

- name: Check if version has been updated
id: check
uses: EndBug/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
file-name: ./backend/package.json

- name: Log when changed
if: steps.check.outputs.changed == 'true'
run: 'echo "Yayy!! Version change found in commit ${{ steps.check.outputs.commit }}! New version: ${{ steps.check.outputs.version }} (${{ steps.check.outputs.type }})"'

- name: Dry run Arka build
run: cd backend && npm install && npm run build

- name: Log when unchanged
if: steps.check.outputs.changed == 'false'
run: echo "No version change :/ Please update version in package.json!" && exit 1
86 changes: 80 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,17 +1,91 @@
name: Trigger Pipeline
name: Build Arka Docker image

on:
push:
branches:
- "master"

jobs:
build:
build_frontend:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout frontend
uses: actions/checkout@v3
-
name: Trigger pipeline
with:
path: frontend
- name: Get frontend package version
id: get_frontend_version
run: echo version=$(node -p "require('./frontend/package.json').version") >> ${{ github.workspace }}/frontend_version.txt
- name: Build and push frontend Docker image
uses: docker/build-push-action@v4
with:
context: ./frontend
file: ./frontend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:${{ steps.get_frontend_version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-frontend:latest
platforms: linux/amd64,linux/arm64

build_admin_frontend:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout admin_frontend
uses: actions/checkout@v3
with:
path: admin_frontend
- name: Get admin_frontend package version
id: get_admin_frontend_version
run: echo version=$(node -p "require('./admin_frontend/package.json').version") >> ${{ github.workspace }}/admin_frontend_version.txt
- name: Build and push admin_frontend Docker image
uses: docker/build-push-action@v4
with:
context: ./admin_frontend
file: ./admin_frontend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:${{ steps.get_admin_frontend_version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-admin-frontend:latest
platforms: linux/amd64,linux/arm64

build_backend:
runs-on: ubuntu-latest
steps:
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Checkout backend
uses: actions/checkout@v3
with:
path: backend
- name: Get backend package version
id: get_backend_version
run: echo version=$(node -p "require('./backend/package.json').version") >> ${{ github.workspace }}/backend_version.txt
- name: Build and push backend Docker image
uses: docker/build-push-action@v4
with:
context: ./backend
file: ./backend/Dockerfile
push: true
tags: |
${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:${{ steps.get_backend_version.outputs.version }}
${{ secrets.DOCKERHUB_USERNAME }}/arka-backend:latest
platforms: linux/amd64,linux/arm64
- name: Create GitHub release
uses: "marvinpinto/action-automatic-releases@6273874b61ebc8c71f1a61b2d98e234cf389b303"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: ${{ steps.get_backend_version.outputs.version }}
prerelease: false
title: Arka ${{ steps.get_backend_version.outputs.version }}
- name: Trigger pipeline
run: ${{ secrets.PIPELINE_TRIGGER }}
4 changes: 2 additions & 2 deletions admin_frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion admin_frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "admin_frontend",
"version": "0.1.0",
"version": "1.0.0",
"private": true,
"dependencies": {
"@emotion/react": "11.11.3",
Expand Down
38 changes: 36 additions & 2 deletions backend/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
/** @type {import('ts-jest').JestConfigWithTsJest} */
export default {
preset: 'ts-jest',
preset: 'ts-jest/presets/js-with-ts-esm',
moduleNameMapper: {
'^(\\.{1,2}/.*)\\.js$': '$1',
},
testEnvironment: 'node',
};
transform: {
'^.+\\.ts?$': [
'ts-jest',
{
useESM: true,
},
],
},
transformIgnorePatterns: [
'node_modules/(?!(data-uri-to-buffer|formdata-polyfill|fetch-blob|node-fetch)/)',
],
testPathIgnorePatterns: [
'/node_modules/',
'/build/'
],
resetModules: true,
testTimeout: 30000,
coverageThreshold: {
global: {
statements: 95,
branches: 75,
functions: 100,
lines: 95,
},
},
coveragePathIgnorePatterns: [
'src/server.ts',
'src/plugins/config.ts',
],
collectCoverage: true,
coverageReporters: ["lcov", "text"]
}
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "arka",
"version": "1.1.8",
"version": "1.1.0",
"description": "ARKA - (Albanian for Cashier's case) is the first open source Paymaster as a service software",
"type": "module",
"directories": {
Expand Down
Loading

0 comments on commit 361a8d8

Please sign in to comment.