Skip to content

Commit

Permalink
Merge pull request #11 from near-daos/develop
Browse files Browse the repository at this point in the history
Pulling up github actions update to release branch
  • Loading branch information
okalenyk authored Jan 18, 2022
2 parents 97d0456 + fe87671 commit 3a12806
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 66 deletions.
68 changes: 2 additions & 66 deletions .github/workflows/build-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ on:
environment:
required: false
description: Specify environment to run on. Valid values are develop, production
apps:
required: false
default: aggregator api
push:
branches:
- develop
Expand All @@ -21,61 +18,6 @@ env:
AWS_ECR_URL: ${{ secrets.AWS_ECR_URL }}

jobs:
get-updated-apps:
name: Get Updated Apps
runs-on: ubuntu-latest
outputs:
updated-apps: ${{ steps.updated-apps.outputs.apps }}
aggregator: ${{ steps.updated-apps.outputs.aggregator }}
api: ${{ steps.updated-apps.outputs.api }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: tj-actions/[email protected]
id: changed-files

- id: updated-apps
shell: bash
run: |
if [[ "${{ github.event.inputs.apps }}" != "" ]]
then
echo "List of apps was provided manually: ${{ github.event.inputs.apps }}"
echo "::set-output name=apps::${{ github.event.inputs.apps }}"
for app in ${{ github.event.inputs.apps }}
do
echo "::set-output name=$app::true"
done
exit 0
fi
for file in ${{ join(steps.changed-files.outputs.modified_files, ' ') }}
do
echo "$file was updated, checking if it is libs file"
if [[ "$file" =~ ^libs/.* ]]
then
echo "$file matched libs"
echo "::set-output name=apps::aggregator api"
echo "::set-output name=aggregator::true"
echo "::set-output name=api::true"
exit 0
fi
done
for app in aggregator api
do
for file in ${{ join(steps.changed-files.outputs.modified_files, ' ') }}
do
echo "$file was updated, checking if it is $app file"
if [[ "$file" =~ ^apps/$app/.* ]]
then
echo "$file is part of $app"
export UPDATED_APPS="$UPDATED_APPS $app"
echo "::set-output name=$app::true"
break
fi
done
done
echo "::set-output name=apps::$UPDATED_APPS"
get-environment:
name: Get Environment
runs-on: ubuntu-latest
Expand Down Expand Up @@ -117,12 +59,10 @@ jobs:
build-image-aggregator:
name: Build Image Aggregator
if: needs.get-updated-apps.outputs.aggregator
env:
APP_NAME: aggregator
runs-on: ubuntu-latest
needs:
- get-updated-apps
- get-environment
environment:
name: ${{ needs.get-environment.outputs.environment }}
Expand All @@ -138,12 +78,10 @@ jobs:

build-image-api:
name: Build Image API
if: needs.get-updated-apps.outputs.api
env:
APP_NAME: api
runs-on: ubuntu-latest
needs:
- get-updated-apps
- get-environment
environment:
name: ${{ needs.get-environment.outputs.environment }}
Expand All @@ -162,7 +100,6 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- get-updated-apps
- get-environment
- build-image-aggregator
- build-image-api
Expand All @@ -182,7 +119,7 @@ jobs:
with:
command: |
set -x
for APP_NAME in ${{ needs.get-updated-apps.outputs.updated-apps }}
for APP_NAME in aggregator api
do
export CHART_FOLDER=apps/${APP_NAME}/deployment/app-chart
helm lint $CHART_FOLDER
Expand All @@ -198,7 +135,6 @@ jobs:
runs-on: ubuntu-latest
if: always()
needs:
- get-updated-apps
- get-environment
- build-image-aggregator
- build-image-api
Expand All @@ -218,7 +154,7 @@ jobs:
with:
command: |
set -x
for APP_NAME in ${{ needs.get-updated-apps.outputs.updated-apps }}
for APP_NAME in aggregator api
do
export CHART_FOLDER=apps/${APP_NAME}/deployment/app-chart
helm lint $CHART_FOLDER
Expand Down
16 changes: 16 additions & 0 deletions apps/api/src/tvl/tvl.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,22 @@ export class TvlController {
return this.tvlService.daoTotals(context);
}

@ApiResponse({
status: 200,
type: MetricResponse,
})
@ApiBadRequestResponse({
description: 'Bad Request Response based on the query params set',
})
@HasDaoContractContext()
@Get('/:dao/tvl')
async daoTvl(
@Param(ContractContextPipe) context: DaoContractContext,
@Query(MetricQueryPipe) metricQuery: MetricQuery,
): Promise<MetricResponse> {
return this.tvlService.tvl(context, metricQuery);
}

@ApiResponse({
status: 200,
type: MetricResponse,
Expand Down

0 comments on commit 3a12806

Please sign in to comment.