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

[WIP] Add approval assembly to encode a role, party, and approval date. #1038

Closed
150 changes: 7 additions & 143 deletions .github/workflows/metaschema-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,29 @@ on:
push:
branches:
- main
paths:
- 'src/metaschema/**'
- '.github/workflows/metaschema-artifacts.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- 'src/metaschema/**'
- '.github/workflows/metaschema-artifacts.yml'
workflow_dispatch:
branches:
- main
name: Build Artifacts and Documentation
name: Build OSCAL Artifacts
env:
# the name of the repo
HOME_REPO: usnistgov/OSCAL
HOME_BRANCH: main
# dependency versions
SAXON_VERSION: 9.9.1-3
HUGO_VERSION: 0.69.2
# build-specific environment
CONTENT_CONFIG_PATH: src/config
SCHEMATRON_HOME: git-content/schematron
OSCAL_HOME: git-content/oscal
OSCAL_CICD_PATH: git-content/oscal/build/ci-cd
OSCAL_WORKING_PATH: git-content/oscal
OSCAL_WEBSITE_PATH: git-content/oscal/docs
OSCAL_SCRATCH_PATH: oscal-scratch
jobs:
check-skip:
Expand Down Expand Up @@ -134,142 +137,3 @@ jobs:
commit_user_name: OSCAL GitHub Actions Bot
commit_user_email: [email protected]
commit_author: OSCAL GitHub Actions Bot <[email protected]>
validate-repo-markdown:
name: Validate Repo Markdown Content
needs: check-skip
if: ${{ needs.check-skip.outputs.skip == 'false' }}
runs-on: ubuntu-18.04
steps:
# use this for pulls where checkout is anonymous
- uses: actions/checkout@v2
with:
path: ${{ env.OSCAL_HOME }}
submodules: recursive
# Setup runtime environment
# -------------------------
- name: Get markdown-link-check
run: |
sudo npm install -g markdown-link-check
# Build Artifacts
# ---------------
- name: Validate repo Markdown content instances
run: |
cd "$OSCAL_HOME"
# this command will filter out any docs Markdown files, which are checked in a different job
git ls-files "*/*.md" -z | grep --null-data -v "^docs/" | xargs -0 -n1 markdown-link-check -q -c "build/config/.markdown-link-check/config.json"
# build-and-publish-website:
# name: Build and Publish Website
# needs: build-and-publish-metaschema-artifacts
# runs-on: ubuntu-18.04
# steps:
# # use this for main repo master builds
# - uses: actions/checkout@v2
# if: ${{ github.repository == env.HOME_REPO && github.ref == format('refs/heads/{0}',env.HOME_BRANCH) }}
# with:
# path: ${{ env.OSCAL_HOME }}
# submodules: recursive
# token: ${{ secrets.COMMIT_TOKEN }}
# - name: Get latest from repo
# if: ${{ github.repository == env.HOME_REPO && github.ref == format('refs/heads/{0}',env.HOME_BRANCH) }}
# # This will ensure that any files committed by the previous job, will be updated
# run: |
# git pull --ff-only
# working-directory: ${{ env.OSCAL_HOME }}
# # use this for pull request builds where checkout uses the builtin token
# - uses: actions/checkout@v2
# if: ${{ github.repository != env.HOME_REPO || github.ref != format('refs/heads/{0}',env.HOME_BRANCH) }}
# with:
# path: ${{ env.OSCAL_HOME }}
# submodules: recursive
# # Setup runtime environment
# # -------------------------
# # Operating System packages
# - name: Update APT package metadata
# run: |
# sudo rm -rf /var/lib/apt/lists/* && sudo apt-get update
# # Java JDK 11
# - name: Set up JDK 11
# uses: actions/setup-java@v2
# with:
# java-version: 11
# distribution: 'adopt'
# - name: Cache Maven packages
# uses: actions/cache@v2
# with:
# path: ~/.m2/repository
# key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
# restore-keys: ${{ runner.os }}-m2-
# - name: Get Saxon-HE
# run: |
# mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DartifactId=Saxon-HE -DgroupId=net.sf.saxon -Dversion=$SAXON_VERSION
# # Ruby and Bundler
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: 2.6 # Not needed with a .ruby-version file
# bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# working-directory: ${{ env.OSCAL_WEBSITE_PATH }}
# # Hugo
# - name: Get Hugo
# run: |
# wget https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.deb
# - name: Install Hugo
# run: |
# sudo apt-get install ./hugo_extended_${HUGO_VERSION}_Linux-64bit.deb
# # Build Artifacts
# # ---------------
# - name: Generate specification documentation
# run: |
# bash "${OSCAL_CICD_PATH}/generate-specification-documentation.sh"
# - uses: actions/upload-artifact@v2
# with:
# name: specification-docs
# path: |
# ${{ env.OSCAL_HOME }}/docs/content/documentation/processing/profile-resolution.html
# retention-days: 5
# # job-generate-docs
# - name: Generate Model Documentation
# run: |
# echo "PWD: ${PWD}"
# echo "OSCAL_HOME: ${OSCAL_HOME}"
# echo "Github Workspace: ${{ github.workspace }}"
# echo "Branch: $(git branch --show-current)"

# BRANCH="${GITHUB_REF}"
# echo "Branch(1): ${BRANCH}"
# if [[ "$BRANCH" =~ ^refs/pull/.* ]]; then
# BRANCH="${GITHUB_HEAD_REF}"
# echo "Branch(2): ${BRANCH}"
# elif [[ "$BRANCH" =~ ^refs/heads/.* ]]; then
# BRANCH="${GITHUB_REF#refs/heads/}"
# echo "Branch(3): ${BRANCH}"
# fi
# echo "Branch(4): ${BRANCH}"
# bash "../build/ci-cd/generate-model-documentation.sh" -b "${BRANCH}"
# working-directory: ${{ github.workspace }}/${{ env.OSCAL_HOME }}/docs
# # - uses: actions/upload-artifact@v2
# # with:
# # name: model-docs
# # path: |
# # ${{ env.OSCAL_HOME }}/docs/layouts/partials/generated
# # retention-days: 5
# - name: Run Hugo
# run: |
# cd "${OSCAL_WEBSITE_PATH}"
# hugo -v --debug --minify
# - uses: actions/upload-artifact@v2
# with:
# name: website
# path: |
# ${{ env.OSCAL_WEBSITE_PATH }}/public
# retention-days: 5
# # - name: Run HTMLProofer
# # run: |
# # cd "${OSCAL_WEBSITE_PATH}"
# # #--allow-hash-href
# # bundle exec htmlproofer --check-external-hash public/ --url-swap "https\://pages.nist.gov/OSCAL/:/" --assume-extension --log-level :debug --url-ignore "/\/OSCAL\/docs\/\/reference\/[^/]+\/[^/]+\/(?:json|xml)-(?:outline|reference|index|definitions)/,/#/,/pages.nist.gov\/(?:nist-header-footer|leaveNotice)\/.+/"
# # - name: Run deploy script
# # if: ${{ github.repository == env.HOME_REPO && github.ref == format('refs/heads/{0}',env.HOME_BRANCH) }}
# # run: |
# # cd "$OSCAL_WEBSITE_PATH"
# # git config user.name "Deployment Bot"
# # bash ./deploy.sh --push-only -v -m "Deploying website [ci deploy skip]"
55 changes: 55 additions & 0 deletions .github/workflows/validate-repo-markdown.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
on:
push:
branches:
- main
paths:
- '!docs/**'
- '**.md'
- '.github/workflows/validate-repo-markdown.yml'
pull_request:
types: [opened, synchronize, reopened]
paths:
- '!docs/**'
- '**.md'
- '.github/workflows/validate-repo-markdown.yml'
workflow_dispatch:
branches:
- main
name: Validate Repo Markdown
env:
# build-specific environment
OSCAL_HOME: git-content/oscal
jobs:
check-skip:
runs-on: ubuntu-latest
outputs:
skip: ${{ steps.ci-skip-step.outputs.ci-skip }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- id: ci-skip-step
uses: mstachniuk/ci-skip@v1
validate-repo-markdown:
name: Validate Repo Markdown Content
needs: check-skip
if: ${{ needs.check-skip.outputs.skip == 'false' }}
runs-on: ubuntu-18.04
steps:
# use this for pulls where checkout is anonymous
- uses: actions/checkout@v2
with:
path: ${{ env.OSCAL_HOME }}
submodules: recursive
# Setup runtime environment
# -------------------------
- name: Get markdown-link-check
run: |
sudo npm install -g markdown-link-check
# Build Artifacts
# ---------------
- name: Validate repo Markdown content instances
run: |
cd "$OSCAL_HOME"
# this command will filter out any docs Markdown files, which are checked in a different job
git ls-files "*/*.md" -z | grep --null-data -v "^docs/" | xargs -0 -n1 markdown-link-check -q -c "build/config/.markdown-link-check/config.json"
Loading