Revamp CI/CD Infrastructure, Simplify Build #16
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OSCAL XSpec Test Suite | |
on: | |
push: | |
branches: | |
- main | |
- develop | |
- "feature-*" | |
- "release-*" | |
paths: | |
- /src | |
- "**.xsl" | |
- "**.xpl" | |
- "**.xspec" | |
pull_request: | |
branches: | |
- main | |
- develop | |
- "feature-*" | |
- "release-*" | |
paths: | |
- /src | |
- "**.xsl" | |
- "**.xpl" | |
- "**.xspec" | |
workflow_call: {} | |
jobs: | |
xspec-tests: | |
if: github.repository == 'usnistgov/OSCAL' || github.event.pull_request.head.repo.name == github.repository | |
name: Run XSpec tests | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: true | |
- name: Login to Docker Hub | |
uses: docker/login-action@v2 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Pull the correct image | |
shell: bash | |
# Produces a tagged image oscal-common-env:selected | |
run: ./build/pull-oscal-env-dockerfile.sh "${{ github.head_ref || github.ref_name }}" | |
- name: Run XSpec tests | |
shell: bash | |
run: | | |
set -o pipefail # propagate return code | |
docker run \ | |
-v $(pwd):/oscal \ | |
-e TEST_DIR=/oscal/xspec \ | |
oscal-common-env:selected \ | |
/oscal/src/utils/util/resolver-pipeline/testing/test.sh \ | |
| tee summary.csv || { | |
if [ "$?" = 83 ]; then | |
# For now we only fail when tests fail to compile | |
echo "Some test suites failed to compile, failing..." | |
exit 1 | |
fi | |
} | |
- name: Upload artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: xspec-output | |
path: | | |
xspec/*.html | |
summary.csv |