Skip to content

Commit

Permalink
feat: update jira and chart, and cleanup repo
Browse files Browse the repository at this point in the history
  • Loading branch information
corang committed May 3, 2024
1 parent a2e436f commit 711d62d
Show file tree
Hide file tree
Showing 26 changed files with 337 additions and 252 deletions.
18 changes: 0 additions & 18 deletions .github/actions/save-logs/action.yaml

This file was deleted.

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

This file was deleted.

20 changes: 20 additions & 0 deletions .github/workflows/ci-docs-shim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: CI Docs Shim

on:
pull_request:
branches: [main]
types: [milestoned, opened, synchronize]

jobs:
run-test:
name: ${{ matrix.type }} ${{ matrix.flavor }}
runs-on: "ubuntu-latest"
timeout-minutes: 20
strategy:
matrix:
flavor: [upstream, registry1]
type: [install, upgrade]
steps:
- name: Shim for ${{ matrix.type }} ${{ matrix.flavor }}
run: |
echo "Documentation-only change detected; marking ${{ matrix.type }} ${{ matrix.flavor }} as successful."
31 changes: 8 additions & 23 deletions .github/workflows/commitlint.yaml
Original file line number Diff line number Diff line change
@@ -1,30 +1,15 @@
name: Metadata

on:
# This workflow is triggered on pull requests to the main branch.
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
# This allows other repositories to call this workflow in a reusable way
workflow_call:

- name: Install commitlint
run: |
npm install --save-dev @commitlint/[email protected]
npm install --save-dev @commitlint/[email protected]
- name: Lint PR title
run: echo "${{ github.event.pull_request.title }}" | npx commitlint
jobs:
validate:
name: Validate
uses: defenseunicorns/uds-common/.github/workflows/commitlint.yaml@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
35 changes: 35 additions & 0 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Scan

on:
# This workflow is triggered on pull requests to the main branch.
pull_request:
branches: [main]
types: [milestoned, opened, synchronize]

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

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

- name: Environment setup
uses: defenseunicorns/uds-common/.github/actions/setup@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
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
- name: Lint the repository
run: |
uds run lint:yaml
50 changes: 50 additions & 0 deletions .github/workflows/scorecard.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Scorecards supply-chain security
on:
# Only the default branch is supported.
branch_protection_rule:
schedule:
- cron: '30 1 * * 6'
push:
branches: ["main"]

# Declare default permissions as read only.
permissions: read-all

jobs:
analysis:
name: Scorecards analysis
runs-on: ubuntu-latest
permissions:
# Needed to upload the results to code-scanning dashboard.
security-events: write
# Used to receive a badge.
id-token: write

steps:
- name: "Checkout code"
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
persist-credentials: false

- name: "Run analysis"
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
with:
results_file: results.sarif
results_format: sarif
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: SARIF file
path: results.sarif
retention-days: 5

# Upload the results to GitHub's code scanning dashboard.
- name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@d39d31e687223d841ef683f52467bd88e9b21c14 # v3.25.3
with:
sarif_file: results.sarif
30 changes: 13 additions & 17 deletions .github/workflows/tag-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: Create release tag
id: tag
uses: google-github-actions/release-please-action@v4.0.1
uses: google-github-actions/release-please-action@a37ac6e4f6449ce8b3f7607e4d97d0146028dc0b # v4.1.0
- id: release-flag
run: echo "release_created=${{ steps.tag.outputs.release_created || false }}" >> $GITHUB_OUTPUT

Expand All @@ -26,31 +26,27 @@ jobs:
name: Publish package
strategy:
matrix:
flavor: [upstream, registry1]
flavor: [registry1]

permissions:
contents: read
packages: write

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Environment setup
uses: ./.github/actions/setup
uses: defenseunicorns/uds-common/.github/actions/setup@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
with:
download-init-package: false
install-k3d: false
install-node: false

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

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: dummy
password: ${{ secrets.GITHUB_TOKEN }}
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Publish Package
run: uds run -f tasks/publish.yaml package --set FLAVOR=${{ matrix.flavor }}

- name: Save logs
if: always()
uses: defenseunicorns/uds-common/.github/actions/save-logs@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
with:
suffix: '${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}'
76 changes: 43 additions & 33 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,65 @@
name: Test package
name: Test

# This workflow is triggered on pull requests to the main branch.
on:
# Manual trigger
workflow_dispatch:

# Triggered by pull-request-conditionals.yaml
workflow_call:
pull_request:
branches: [main]
types: [milestoned, opened, synchronize]
paths-ignore:
- "**.md"
- "**.jpg"
- "**.png"
- "**.gif"
- "**.svg"
- "adr/**"
- "docs/**"
- ".gitignore"
- "renovate.json"
- ".release-please-config.json"
- "release-please-config.json"
- "oscal-component.yaml"
- "CODEOWNERS"
- "LICENSE"
- "CONTRIBUTING.md"
- "SECURITY.md"

# Abort prior jobs in the same workflow / PR
concurrency:
group: test-${{ github.ref }}-${{ inputs.package }}
group: test-${{ github.ref }}
cancel-in-progress: true

permissions:
contents: read

jobs:
test:
runs-on: "ubuntu-latest"
timeout-minutes: 20
name: Test
run-test:
name: ${{ matrix.type }} ${{ matrix.flavor }}
runs-on: uds-ubuntu-big-boy-8-core
timeout-minutes: 25
strategy:
matrix:
flavor: [upstream, registry1]
flavor: [registry1]
type: [install, upgrade]

steps:
- name: Checkout repository
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

- name: Environment setup
uses: ./.github/actions/setup

- name: Iron Bank Login
run: 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 --set FLAVOR=${{ matrix.flavor }}

- name: Setup cluster
run: uds run setup-cluster
uses: defenseunicorns/uds-common/.github/actions/setup@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
with:
registry1Username: ${{ secrets.IRON_BANK_ROBOT_USERNAME }}
registry1Password: ${{ secrets.IRON_BANK_ROBOT_PASSWORD }}
ghToken: ${{ secrets.GITHUB_TOKEN }}

- name: Deploy test bundle
run: uds run deploy-test-bundle

- name: Test package
run: uds run test-package

- name: Cleanup
if: always()
run: uds run cleanup
- name: Test
uses: defenseunicorns/uds-common/.github/actions/test@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
with:
flavor: ${{ matrix.flavor }}
type: ${{ matrix.type }}

- name: Save logs
if: always()
uses: ./.github/actions/save-logs
uses: defenseunicorns/uds-common/.github/actions/save-logs@b2e8b25930c953ef893e7c787fe350f0d8679ee2 # v0.4.2
with:
suffix: ${{ matrix.type }}-${{ matrix.flavor }}-${{ github.run_id }}-${{ github.run_attempt }}
17 changes: 14 additions & 3 deletions bundle/uds-bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,20 @@ metadata:
# x-release-please-end

packages:
- name: dev-postgres
repository: ghcr.io/defenseunicorns/packages/uds/dev-postgres
ref: 0.0.2
- name: dev-namespace
path: ../
ref: 0.1.0

- name: postgres-operator
repository: ghcr.io/defenseunicorns/packages/uds/postgres-operator
ref: 1.10.1-uds.4-upstream
overrides:
postgres-operator:
uds-postgres-config:
variables:
- name: POSTGRESQL
description: "Configure postgres using CRs via the uds-postgres-config chart"
path: postgresql

- name: dev-secrets
path: ../
Expand Down
Loading

0 comments on commit 711d62d

Please sign in to comment.