Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update to callable workflow #68

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 2 additions & 22 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,8 @@

jobs:
validate:
runs-on: ubuntu-latest
name: Lint
permissions:
contents: read # Allows reading the repo contents

steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
fetch-depth: 0

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Install lint deps
run: |
uds run lint:deps --no-progress

- name: Lint the repository
run: |
uds run lint:yaml --no-progress
uses: defenseunicorns/uds-common/.github/workflows/callable-lint.yaml@243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals
secrets: inherit # Inherits all secrets from the parent workflow.

Check failure on line 15 in .github/workflows/lint.yaml

View workflow job for this annotation

GitHub Actions / Lint / run

15:70 [new-line-at-end-of-file] no new line character at the end of file
36 changes: 36 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish UDS Package Postgres Operator

on:
push:
branches:
- main

# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
contents: read # Allows reading the content of the repository.
packages: read # Allows reading the content of the repository's packages.
id-token: write

jobs:
tag-new-version:
permissions: write-all
runs-on: ubuntu-latest
outputs:
release_created: ${{ steps.release-flag.outputs.release_created }}
steps:
- name: Create Release Tag
id: tag
uses: googleapis/release-please-action@7987652d64b4581673a76e33ad5e98e3dd56832f # v4.1.3
- id: release-flag
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT

publish:
needs: tag-new-version
if: ${{ needs.tag-new-version.outputs.release_created == 'true' }}
strategy:
matrix:
flavor: [upstream, registry1, unicorn]
uses: defenseunicorns/uds-common/.github/workflows/callable-publish.yaml@243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals
with:
flavor: ${{ matrix.flavor }}
secrets: inherit # Inherits all secrets from the parent workflow.
64 changes: 0 additions & 64 deletions .github/workflows/tag-and-release.yaml

This file was deleted.

53 changes: 24 additions & 29 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,40 +29,35 @@ concurrency:
cancel-in-progress: true

permissions:
contents: read
contents: read # Allows reading the content of the repository.
packages: read # Allows reading the content of the repository's packages.
id-token: write

jobs:
test:
name: ${{ matrix.type }} ${{ matrix.flavor }}
flavor-test:
name: Test-Flavor
runs-on: ubuntu-latest
strategy:
matrix:
flavor: [upstream, registry1]
type: [install, upgrade]

steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Test
uses: defenseunicorns/uds-common/.github/actions/test@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
with:
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}
- name: test-flavor
uses: defenseunicorns/uds-common/.github/actions/test-flavor@243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals
id: test-flavor
outputs:
upgrade-flavors: ${{ steps.test-flavor.outputs.upgrade-flavors }}

- name: Debug Output
if: ${{ always() }}
uses: defenseunicorns/uds-common/.github/actions/debug-output@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@e7c0643d3f9d74ce49c7386b48964d2be646d726 # v0.10.0
with:
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
test-deploy:
needs: flavor-test
strategy:
fail-fast: false
matrix:
type: [install, upgrade]
flavor: [upstream, unicorn, registry1]
uses: defenseunicorns/uds-common/.github/workflows/callable-test.yaml@243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals
with:
upgrade-flavors: ${{ needs.flavor-test.outputs.upgrade-flavors }}
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}
udsCommonVersion: 243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals
secrets: inherit # Inherits all secrets from the parent workflow.
1 change: 1 addition & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ includes:
- pull: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/pull.yaml
- deploy: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/deploy.yaml
- setup: https://raw.githubusercontent.com/defenseunicorns/uds-common/v0.10.0/tasks/setup.yaml
- actions: https://raw.githubusercontent.com/defenseunicorns/uds-common/243-update-uds-common-gh-actions-to-use-maruuds-run-conditionals/tasks/actions.yaml

tasks:
- name: default
Expand Down
Loading