Skip to content

Commit

Permalink
chore: migrate to uds-common shared actions and workflows (#41)
Browse files Browse the repository at this point in the history
* migrate to uds-common shared actions and workflows

* update to uds packaged zarf instead of bare zarf

* zarf -> uds zarf

* correcting reference to commitlint workflow

* chore: update job name for consistent case

* ci: add milestoned pr trigger type

---------

Co-authored-by: zamaz <71521611+zachariahmiller@users.noreply.github.com>
  • Loading branch information
ericwyles and zachariahmiller authored Feb 29, 2024
1 parent 4ef3dd2 commit 42e1f96
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 80 deletions.
18 changes: 0 additions & 18 deletions .github/actions/save-logs/action.yaml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/actions/setup/action.yaml

This file was deleted.

27 changes: 4 additions & 23 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,9 @@ name: Metadata
on:
pull_request:
branches: [main]
types: [opened, edited, synchronize]
types: [milestoned, opened, edited, synchronize]

jobs:
title_check:
runs-on: ubuntu-latest
name: Validate PR Title
permissions:
pull-requests: read

steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0

- name: Setup Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0

- name: Install commitlint
run: |
npm install --save-dev @commitlint/config-conventional@18.6.0
npm install --save-dev @commitlint/cli@18.6.0
- name: Lint PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
validate:
name: Validate
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@417b9c2bc088f664c616c9929a2b3ce448d251f7
4 changes: 3 additions & 1 deletion .github/workflows/pull-request-conditionals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ on:
- "tests/**"
- "tasks.yaml"
- "zarf.yaml"

# milestoned is added here as a workaround for release-please not triggering PR workflows (PRs should be added to a milestone to trigger the workflow).
types: [milestoned, opened, reopened, synchronize]

# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
id-token: write # Needed for OIDC-related operations.
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: ./.github/actions/setup
uses: defenseunicorns/uds-common/.github/actions/setup@417b9c2bc088f664c616c9929a2b3ce448d251f7

- name: Iron Bank Login
run: zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil
Expand All @@ -53,6 +53,6 @@ jobs:

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
uses: defenseunicorns/uds-common/.github/actions/save-logs@417b9c2bc088f664c616c9929a2b3ce448d251f7
with:
suffix: -${{ matrix.flavor }}
suffix: '${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}'
8 changes: 5 additions & 3 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Environment setup
uses: ./.github/actions/setup
uses: defenseunicorns/uds-common/.github/actions/setup@417b9c2bc088f664c616c9929a2b3ce448d251f7

- name: Iron Bank Login
run: zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil
run: uds zarf tools registry login -u "${{secrets.IRON_BANK_ROBOT_USERNAME}}" -p "${{secrets.IRON_BANK_ROBOT_PASSWORD}}" registry1.dso.mil

- name: Create test bundle
run: uds run create-test-bundle
Expand All @@ -45,4 +45,6 @@ jobs:

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
uses: defenseunicorns/uds-common/.github/actions/save-logs@417b9c2bc088f664c616c9929a2b3ce448d251f7
with:
suffix: '${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}'
4 changes: 2 additions & 2 deletions tasks/create.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ tasks:
- name: gitlab-package
description: Create the UDS Gitlab Zarf Package
actions:
- cmd: zarf package create --confirm --no-progress --architecture=${ZARF_ARCHITECTURE} --flavor ${FLAVOR}
- cmd: uds zarf package create --confirm --no-progress --architecture=${ZARF_ARCHITECTURE} --flavor ${FLAVOR}

- name: dependency-package
description: Create the Minio, PostgreSQL, and Redis Dependency Zarf Packages
actions:
- cmd: zarf package create src/dev-secrets/ --confirm --no-progress --architecture=${UDS_ARCH} --skip-sbom
- cmd: uds zarf package create src/dev-secrets/ --confirm --no-progress --architecture=${UDS_ARCH} --skip-sbom

0 comments on commit 42e1f96

Please sign in to comment.