compliance-trestle icon indicating copy to clipboard operation
compliance-trestle copied to clipboard

Deploy windows pipeline with saxon-c to compliance-trestle-fedramp

Open butler54 opened this issue 3 years ago • 1 comments

Issue description / feature objectives

Build a simple bat file that download saxon-C and installs the python binding.

A similar script has been built for ubuntu: https://github.com/IBM/compliance-trestle/blob/fix/CI_support_for_saxon/scripts/ubuntu_saxon_install.sh

NOTE: Environmental variables are set outside of the path.

Build a similar script for windows and test locally (before subsequent integration with the CI environment.

butler54 avatar Oct 13 '21 02:10 butler54

Here is the main code needed to build saxonc on windows. It works ok but the path "D:\a\action-play..." needs to be changed to the correct absolute path in which the github action operates.

I tried to use a relative local path in the /dest parameter: /dest .\sax - but it did not get installed there.

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "build"
  build:
    # The type of runner that the job will run on
    runs-on: windows-latest

    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
      # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
      - uses: actions/checkout@v2
      
      - name: set up python 3.8
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
      
      - name: install deps
        run: |
          python -m pip install --upgrade pip
          pip install cython
      # set up the visual studio build tools so they can be invoked at the command line
      - uses: ilammy/msvc-dev-cmd@v1
 
      # download saxonc with the built-in powershell command rather than wget.
      - name: download saxonc
        run: |
          Invoke-WebRequest -Uri https://www.saxonica.com/saxon-c/libsaxon-HEC-win-setup-v1.2.1.exe -OutFile saxon.exe
          
      # install saxonc in non-interactive batch mode and specify the destination directory
      - name: install saxonc
        run: |
          .\saxon.exe /batch /dest "D:\a\action-play\action-play\sax"
          
      - name: build saxonc
        run: |
          cd "D:\a\action-play\action-play\sax\Saxon.C.API\python-saxon"
          python saxon-setup.py build_ext -if

fsuits avatar Oct 18 '21 04:10 fsuits