Skip to content

Commit

Permalink
use versions matrix for snapshot testing
Browse files Browse the repository at this point in the history
This reverts commit 5679abd.
  • Loading branch information
wandmagic committed Jan 13, 2025
1 parent 8898199 commit 8993b2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/run-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@ jobs:
# one job that runs tests
run-tests:
runs-on: ubuntu-20.04
# Checkout repository and its submodules
strategy:
matrix:
version: ['latest', 'snapshot']
name: Run tests (${{ matrix.version }})
# Checkout repository and its submodules
steps:
# Check-out the repository under $GITHUB_WORKSPACE
- name: Checkout repository
Expand All @@ -38,6 +42,8 @@ jobs:
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install OSCAL CLI
env:
USE_SNAPSHOT: ${{ matrix.version == 'snapshot' && '1' || '' }}
run: |
make configure
- name: Run Lint tests
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-20.04, windows-2022]
version: ['latest', 'snapshot']
runs-on: ${{ matrix.os }}
name: Test (${{ matrix.os }}, ${{ matrix.version }})
# Checkout repository and its submodules
steps:
# Check-out the repository under $GITHUB_WORKSPACE
Expand All @@ -43,6 +45,8 @@ jobs:
with:
node-version: ${{ steps.nvmrc.outputs.NODE_VERSION }}
- name: Install OSCAL CLI
env:
USE_SNAPSHOT: ${{ matrix.version == 'snapshot' && '1' || '' }}
run: |
make init-validations
- name: Run Cucumber tests
Expand Down
9 changes: 7 additions & 2 deletions src/validations/module.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
# Variables
OSCAL_VERSION = $(shell jq -r .dependencies.oscal package.json)
OSCAL_CLI_VERSION = $(shell awk '/^oscal-cli/ {print $$2}' .tool-versions)
OSCAL_SERVER_VERSION = $(shell awk '/^oscal-server/ {print $$2}' .tool-versions)
ifdef USE_SNAPSHOT
OSCAL_CLI_VERSION = $(shell awk '/^oscal-cli-snapshot/ {print $$2}' .tool-versions)
OSCAL_SERVER_VERSION = $(shell awk '/^oscal-server-snapshot/ {print $$2}' .tool-versions)
else
OSCAL_CLI_VERSION = $(shell awk '/^oscal-cli / {print $$2}' .tool-versions)
OSCAL_SERVER_VERSION = $(shell awk '/^oscal-server / {print $$2}' .tool-versions)
endif
OSCAL_CLI = npx oscal@$(OSCAL_VERSION)
SRC_DIR = ./src
DIST_DIR = ./dist
Expand Down

0 comments on commit 8993b2a

Please sign in to comment.