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

fix: update ci workflows for docs shim #700

Merged
merged 14 commits into from
Aug 29, 2024
19 changes: 19 additions & 0 deletions .github/actions/lint-check/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: lint-check
description: "Check Project for Linting Errors"

runs:
using: composite
steps:
- name: Use Node.js latest
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install UDS CLI
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
run: brew install defenseunicorns/tap/uds@0.14.2
shell: bash
- name: Run Formatting Checks
run: uds run lint-check --no-progress
shell: bash
71 changes: 71 additions & 0 deletions .github/filters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,96 @@ all:

authservice:
- "src/authservice/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

grafana:
- "src/grafana/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

istio:
- "src/istio/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

keycloak:
- "src/keycloak/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

kiali:
- "src/kiali/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

loki:
- "src/loki/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

metrics-server:
- "src/metrics-server/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

neuvector:
- "src/neuvector/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

prometheus-stack:
- "src/prometheus-stack/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

promtail:
- "src/promtail/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

tempo:
- "src/tempo/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"

velero:
- "src/velero/**"
- "!**/*.md"
- "!**/*.jpg"
- "!**/*.png"
- "!**/*.gif"
- "!**/*.svg"
43 changes: 43 additions & 0 deletions .github/workflows/docs-shim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CI Docs

on:
pull_request:
types: [milestoned, opened, reopened, synchronize]
paths:
- "**.md"
- "**.jpg"
- "**.png"
- "**.gif"
- "**.svg"
- docs/**
- .vscode/**
- .gitignore
- renovate.json
- .release-please-config.json
- release-please-config.json
- CODEOWNERS
- LICENSE

jobs:
lint-check:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: lint-check
uses: ./.github/actions/lint-check

run-package-test:
needs: lint-check
name: Schedule
strategy:
matrix:
package: [all]
flavor: [upstream, registry1, unicorn]
test_type: [install, upgrade]
uses: ./.github/workflows/test-shim.yaml
with:
package: ${{ matrix.package }}
flavor: ${{ matrix.flavor }}
test_type: ${{ matrix.test_type }}
secrets: inherit # Inherits all secrets from the parent workflow.
5 changes: 5 additions & 0 deletions .github/workflows/nightly-testing.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ on:
- .github/bundles/*
- .github/test-infra/buckets-iac/*

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

jobs:
nightly-testing:
name: Test Core on EKS
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Publish UDS Core

on:
# triggered by tag-and-release.yaml and snapshot-release.yaml
workflow_call:
inputs:
snapshot:
Expand Down
32 changes: 19 additions & 13 deletions .github/workflows/pull-request-conditionals.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@ on:
pull_request:
# 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]
paths-ignore:
- "**.md"
- "**.jpg"
- "**.png"
- "**.gif"
- "**.svg"
- docs/**
- .vscode/**
- .gitignore
- renovate.json
- .release-please-config.json
- release-please-config.json
- CODEOWNERS
- LICENSE

# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
Expand All @@ -27,19 +41,10 @@ jobs:
lint-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Use Node.js latest
uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b # v4.0.3
with:
node-version: 20
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Install UDS CLI
shell: bash
# renovate: datasource=github-tags depName=defenseunicorns/uds-cli versioning=semver
run: brew install defenseunicorns/tap/uds@0.14.2
- name: Run Formatting Checks
run: uds run lint-check --no-progress
- name: Checkout repository
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: lint-check
uses: ./.github/actions/lint-check

# This job checks if there are changes in specific paths source packages.
check-paths:
Expand All @@ -59,6 +64,7 @@ jobs:
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
with:
filters: .github/filters.yaml
predicate-quantifier: every

# This job triggers a separate workflow for each changed source package, if any.
run-package-test:
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/slim-dev-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,18 @@ on:
# 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]
paths:
- src/pepr/*
- src/keycloak/*
- src/istio/*
- src/prometheus-stack/*
- packages/slim-dev/*
- bundles/k3d-slim-dev/*
- .github/workflows/slim-dev*
- src/pepr/**
- src/keycloak/**
- src/istio/**
- src/prometheus-stack/**
- packages/slim-dev/**
- bundles/k3d-slim-dev/**
- .github/workflows/slim-dev**
- "!**/*.md"
- "!**.jpg"
- "!**.png"
- "!**.gif"
- "!**.svg"

# Permissions for the GITHUB_TOKEN used by the workflow.
permissions:
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/test-eks.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: Test Core On EKS

on:
# triggered by nightly-testing.yaml
workflow_call:
inputs:
flavor:
Expand Down
42 changes: 42 additions & 0 deletions .github/workflows/test-shim.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Test Shim

on:
# Manual trigger
workflow_dispatch:
inputs:
package:
type: string
description: "The name of the source package to test"
required: true
flavor:
type: string
description: "Flavor of the source package to test"
required: true
test_type:
type: string
description: "The type of test to perform"
required: true
# Triggered by pull-request-conditionals.yaml
workflow_call:
inputs:
package:
type: string
description: "The name of the source package to test"
required: true
flavor:
type: string
description: "Flavor of the source package to test"
required: true
test_type:
type: string
description: "The type of test to perform"
required: true

jobs:
test:
runs-on: 'ubuntu-latest'
name: Test
steps:
- name: Skipped
run: |
echo skipped
Loading