Skip to content

Merge pull request #557 from fjogeleit/pr-exists-handling #606

Merge pull request #557 from fjogeleit/pr-exists-handling

Merge pull request #557 from fjogeleit/pr-exists-handling #606

Workflow file for this run

name: 'build-test'
on:
push:
branches:
- main
- development
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: |
npm install
- run: |
npm run all
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'backend.version'
masterBranchName: main
value: v1.0.1
branch: deployment/v1.0.1
targetBranch: main
createPR: 'false'
message: 'Update Image Version to v1.0.1'
token: ${{ secrets.GH_TOKEN }}
test-no-changes-did-not-fail:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'backend.version'
masterBranchName: main
value: v1.2.0
branch: deployment/v1.2.0
targetBranch: main
createPR: 'false'
message: 'Update Image Version to v1.2.0'
token: ${{ secrets.GH_TOKEN }}
test-target-repository:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
path: infrastructure
- name: Update values.yaml
uses: ./infrastructure
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'backend.version'
value: v1.2.1
masterBranchName: main
branch: deployment/v1.2.1
targetBranch: main
createPR: 'false'
message: 'Update Image Version to v1.2.1'
workDir: infrastructure
token: ${{ secrets.GH_TOKEN }}
test-update-file:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cat Original values.yaml
run: cat __tests__/fixtures/values.yaml
- name: Update values.yaml
uses: ./
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'backend.version'
value: v1.0.1
masterBranchName: main
commitChange: 'false'
- name: Cat Updated values.yaml
run: cat __tests__/fixtures/values.yaml
test-multiple-file-changes:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
branch: deployment/test-multi-file-update
masterBranchName: main
createPR: 'false'
targetBranch: main
description: Test GitHub Action
message: 'Update All Images'
title: 'Version Updates on all Environments'
changes: |
{
"__tests__/fixtures/values.json": {
"backend.version": "v1.0.1",
"frontend": true
},
"__tests__/fixtures/values.dev.yaml": {
"backend.version": "v1.0.1",
"frontend": true
},
"__tests__/fixtures/values.stage.yaml": {
"backend.version": "v1.0.1",
"frontend": true
},
"__tests__/fixtures/values.prod.yaml": {
"backend.version": "v1.0.1",
"frontend": true
}
}
test-value-types:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'config.prod'
value: "!!bool 'true'"
branch: deployment/test-bool-value
masterBranchName: main
targetBranch: main
description: Test GitHub Action
message: 'Update Config'
title: 'Bool Update on all Environments'
token: ${{ secrets.GH_TOKEN }}
- uses: ./
with:
valueFile: '__tests__/fixtures/values.yaml'
propertyPath: 'config.version'
value: "!!int '1234'"
branch: deployment/test-int-value
masterBranchName: main
targetBranch: main
description: Test GitHub Action
message: 'Update Config'
title: 'Int Update on all Environments'
token: ${{ secrets.GH_TOKEN }}
cleanup:
runs-on: ubuntu-latest
needs:
- test-target-repository
- test-update-file
- test-multiple-file-changes
- test-value-types
steps:
- uses: actions/checkout@v3
- name: Delete test branches
uses: dawidd6/action-delete-branch@v3
with:
token: ${{ secrets.GH_TOKEN }}
branches: deployment/v1.2.1,deployment/v1.0.1,deployment/test-bool-value,deployment/test-int-value,deployment/test-multi-file-update