Skip to content

Commit

Permalink
chore(oscsal): update workflows to separate tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
brandtkeller committed Jul 3, 2024
1 parent e8c1178 commit cf240d3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 28 deletions.
25 changes: 6 additions & 19 deletions .github/workflows/lint-oscal.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: Lint OSCAL Files

on:
push:
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:
- '**/*oscal*.yaml'

Expand Down Expand Up @@ -46,24 +48,9 @@ jobs:
# checkout for access to the oscal files targeted for linting
- name: Checkout the code
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# setup uds-cli
- name: Use Node.js latest
uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2
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/[email protected]
# will be pinning this when a tag is released
- name: Install Lula
uses: defenseunicorns/lula-action/setup@095636b7880051e11b05f10a582fdd911526161c
with:
# renovate: datasource=github-tags depName=defenseunicorns/lula versioning=semver-coerced
version: v0.4.1
- name: Environment setup
uses: ./.github/actions/setup
# lint the oscal files
- name: lint-oscal
run: uds run lint-oscal --set OSCALFILES=${{ steps.find_changed_files.outputs.oscal_files }}
run: uds run lint-oscal --set OSCALFILES=${{ steps.find_changed_files.outputs.oscal_files }} --no-progress
shell: bash
8 changes: 8 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,14 @@ jobs:
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-uds-core --set FLAVOR=${{ inputs.flavor }} --no-progress

- name: Validate UDS Core Compliance
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-compliance-validate --no-progress

- name: Evaluate UDS Core Compliance
if: ${{ inputs.package == 'all' && inputs.test_type == 'install' }}
run: uds run test-compliance-evaluate --no-progress

- name: Test UDS Core Upgrade
if: ${{ inputs.package == 'all' && inputs.test_type == 'upgrade' }}
run: uds run test-uds-core-upgrade --set FLAVOR=${{ inputs.flavor }} --no-progress
Expand Down
8 changes: 8 additions & 0 deletions tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,14 @@ tasks:
actions:
- task: test:uds-core-upgrade

- name: test-compliance-validate
actions:
- tasks: test:compliance-validate

- name: test-compliance-evaluate
actions:
- tasks: test:compliance-evaluate

- name: lint-check
actions:
- task: lint:check
Expand Down
26 changes: 17 additions & 9 deletions tasks/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,6 @@ tasks:
- task: create:k3d-standard-bundle
- task: deploy:k3d-standard-bundle
- task: validate-packages
- task: compliance:validate
with:
oscalfile: ./compliance/oscal-component.yaml
assessment_results: ./compliance/oscal-assessment-results.yaml
- task: compliance:evaluate
with:
assessment_results: ./compliance/oscal-assessment-results.yaml
- description: copy assessment file to log location
cmd: cp ./compliance/oscal-assessment-results.yaml /tmp/oscal-assessment-results.yaml

- name: uds-core-upgrade
description: "Test an upgrade from the latest released UDS Core package to current branch"
Expand All @@ -50,3 +41,20 @@ tasks:
- task: create:standard-package
- task: deploy:standard-package
- task: validate-packages

- name: validate-compliance
description: "validate against the required compliance"
actions:
- task: compliance:validate
with:
oscalfile: ./compliance/oscal-component.yaml
assessment_results: ./compliance/oscal-assessment-results.yaml

- name: evaluate-compliance
description: "evaluate against the required compliance"
actions:
- task: compliance:evaluate
with:
assessment_results: ./compliance/oscal-assessment-results.yaml
- description: copy assessment file to log location
cmd: cp ./compliance/oscal-assessment-results.yaml /tmp/oscal-assessment-results.yaml

0 comments on commit cf240d3

Please sign in to comment.