Skip to content

fix(flavors): use correct fontist version command #61

fix(flavors): use correct fontist version command

fix(flavors): use correct fontist version command #61

name: Integration Test - Single Document
on:
push:
branches: [ main ]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# Test single document compilation across all platforms and installation methods
test-compile-single:
name: Compile ${{ matrix.os }} ${{ matrix.installation-method }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
installation-method: [ native, gem ]
include:
# Native installation methods per platform
- os: ubuntu-latest
installation-method: native
method: snap
- os: macos-latest
installation-method: native
method: homebrew
- os: windows-latest
installation-method: native
method: choco
# Dev tools for Windows gem installation
- os: windows-latest
installation-method: gem
windows-toolchain: true
steps:
- name: Checkout action
uses: actions/checkout@v6
- name: Checkout mn-samples-cc
uses: actions/checkout@v6
with:
repository: metanorma/mn-samples-cc
path: mn-samples-cc
# For gem installation, setup Ruby first
- name: Setup Ruby (gem method)
if: matrix.installation-method == 'gem'
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.4'
bundler-cache: true
windows-toolchain: ${{ matrix.windows-toolchain || '' }}
- name: Setup Metanorma
uses: ./
with:
installation-method: ${{ matrix.method || matrix.installation-method }}
- name: Bundle install (gem method)
if: matrix.installation-method == 'gem'
working-directory: mn-samples-cc
shell: bash
run: |
echo "Running bundle install in test repository..."
bundle install
echo "Bundle install completed"
- name: Verify Metanorma installation
shell: bash
run: |
${{ matrix.installation-method == 'gem' && 'bundle exec' || '' }} metanorma --version
${{ matrix.installation-method == 'gem' && 'bundle exec' || '' }} metanorma help
- name: Compile single document
shell: bash
working-directory: mn-samples-cc
run: |
echo "Running: ${{ matrix.installation-method == 'gem' && 'bundle exec' || '' }} metanorma compile --agree-to-terms sources/cc-18011.adoc"
${{ matrix.installation-method == 'gem' && 'bundle exec' || '' }} metanorma compile --agree-to-terms sources/cc-18011.adoc
echo "Compilation completed successfully"
- name: Verify output files exist
shell: bash
working-directory: mn-samples-cc
run: |
# Check for common output files (accept both .doc and .docx)
OUTPUT_DIR="sources"
HTML_FOUND=false
DOC_FOUND=false
PDF_FOUND=false
[ -f "$OUTPUT_DIR/cc-18011.html" ] && HTML_FOUND=true
[ -f "$OUTPUT_DIR/cc-18011.doc" ] || [ -f "$OUTPUT_DIR/cc-18011.docx" ] && DOC_FOUND=true
[ -f "$OUTPUT_DIR/cc-18011.pdf" ] && PDF_FOUND=true
if [ "$HTML_FOUND" = true ] || [ "$DOC_FOUND" = true ] || [ "$PDF_FOUND" = true ]; then
echo "✓ Output files generated:"
ls -la "$OUTPUT_DIR"/cc-18011.* 2>/dev/null || true
else
echo "✗ No output files found in $OUTPUT_DIR"
echo "Directory contents:"
ls -la "$OUTPUT_DIR" || true
exit 1
fi
- name: Upload compiled documents
uses: actions/upload-artifact@v4
if: always()
with:
name: compiled-docs-${{ matrix.os }}-${{ matrix.installation-method }}
path: |
mn-samples-cc/sources/cc-18011.html
mn-samples-cc/sources/cc-18011.doc
mn-samples-cc/sources/cc-18011.docx
mn-samples-cc/sources/cc-18011.pdf
retention-days: 7
if-no-files-found: warn