Skip to content

Commit

Permalink
chore: validate score files in ci
Browse files Browse the repository at this point in the history
  • Loading branch information
johanneswuerbach committed Apr 26, 2024
1 parent 47b6eff commit a5b2c9f
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 8 deletions.
32 changes: 31 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
pull_request:
branches: [main]
jobs:
job:
containers:
runs-on: ubuntu-latest
steps:
- name: checkout code
Expand All @@ -20,3 +20,33 @@ jobs:
run: |
mkdir credentials && touch credentials/github-app-backstage-humanitec-credentials.yaml
docker image build -t backstage:latest .
validate-score:
runs-on: ubuntu-latest
env:
HUMCTL_VERSION: '0.23.1'
steps:
- name: checkout code
uses: actions/checkout@v3
- uses: humanitec/setup-cli-action@v1
with:
version: ${{ env.HUMCTL_VERSION }}
- name: humctl score validate - backstage
run: |
humctl score validate --local --strict \
score.yaml
- name: humctl score validate - node-service
run: |
score_file=templates/node-service/content/score.yaml
# Replace template string with actual values, sadly no better way yet
# https://github.com/backstage/backstage/issues/13668
sed -i -e 's/${{ '${{ values.name | dump }}' }}/test-workload/g' "$score_file"
humctl score validate --local --strict \
"$score_file"
- name: humctl score validate - podinfo
run: |
score_file=templates/podinfo-example/content/score.yaml
# Replace template string with actual values
sed -i -e 's/${{ '${{ values.name | dump }}' }}/test-workload/g' "$score_file"
humctl score validate --local --strict \
"$score_file"
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ concurrency: ${{ github.ref }}

env:
IMAGE: backstage
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'
# CLOUD_PROVIDER: aws
AWS_REGION: ${{ vars.AWS_REGION }}
AWS_ROLE_ARN: ${{ vars.AWS_ROLE_ARN }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
APP_NAME: ${{ values.name }}
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'

{% raw %}
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{%- else -%}
# Unknown cloud provider: ${{ values.cloudProvider }}
{% endif %}
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'
APP_NAME: ${{ values.name }}

{% raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{% endif %}
BASE_ENVIRONMENT: 'development'
ENVIRONMENT_TYPE: 'development'
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
ENVIRONMENT_NAME: {% raw %}PR-${{ github.event.number }}{% endraw %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
env:
APP_NAME: ${{ values.name }}
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'

{% raw %}
jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{%- else -%}
# Unknown cloud provider: ${{ values.cloudProvider }}
{% endif %}
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'
APP_NAME: ${{ values.name }}

{% raw %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ env:
{% endif %}
BASE_ENVIRONMENT: 'development'
ENVIRONMENT_TYPE: 'development'
HUMCTL_VERSION: '0.21.0'
HUMCTL_VERSION: '0.23.1'
ENVIRONMENT_ID: {% raw %}pr-${{ github.event.number }}{% endraw %}
ENVIRONMENT_NAME: {% raw %}PR-${{ github.event.number }}{% endraw %}

Expand Down

0 comments on commit a5b2c9f

Please sign in to comment.