Skip to content

Commit

Permalink
use versions in matrix for snapshot testing
Browse files Browse the repository at this point in the history
  • Loading branch information
wandmagic committed Jan 13, 2025
1 parent 9f46f60 commit 5679abd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 4 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
4 changes: 3 additions & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
oscal-cli 2.4.0
oscal-server v1.0.0-SNAPSHOT-6773e8b-20250108155951
oscal-cli-snapshot 2.5.0-SNAPSHOT
oscal-server v1.0.0-SNAPSHOT-6363f60-20241202160440
oscal-server-snapshot v1.0.0-SNAPSHOT-6773e8b-20250108155951
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 5679abd

Please sign in to comment.