Create CLAUDE.md #35
This file contains hidden or 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: Build and test | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| test: | |
| name: Build and test | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| sql-version: ["2017-latest", "2019-latest", "2022-latest"] | |
| services: | |
| sqlserver: | |
| image: mcr.microsoft.com/mssql/server:${{ matrix.sql-version }} | |
| env: | |
| SA_PASSWORD: ${{ secrets.SA_PASSWORD }} | |
| ACCEPT_EULA: Y | |
| ports: | |
| - 1433:1433 | |
| options: >- | |
| --health-cmd "timeout 1 bash -c 'cat < /dev/null > /dev/tcp/localhost/1433'" | |
| --health-interval 10s | |
| --health-timeout 5s | |
| --health-retries 5 | |
| --health-start-period 10s | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "22" | |
| cache: npm | |
| - name: Install dependencies | |
| run: npm ci | |
| - name: Build project | |
| run: npm run build | |
| - name: Run lint | |
| run: npm run lint | |
| - name: Check formatting | |
| run: npm run format:check | |
| - name: Install SQL Server command-line tools | |
| run: | | |
| curl https://packages.microsoft.com/keys/microsoft.asc | sudo tee /etc/apt/trusted.gpg.d/microsoft.asc | |
| curl https://packages.microsoft.com/config/ubuntu/$(lsb_release -rs)/prod.list | sudo tee /etc/apt/sources.list.d/mssql-release.list | |
| sudo apt-get update | |
| sudo ACCEPT_EULA=Y apt-get install -y mssql-tools18 unixodbc-dev | |
| echo "/opt/mssql-tools18/bin" >> $GITHUB_PATH | |
| - name: Create test database | |
| run: sqlcmd -S localhost -U sa -P "${SA_PASSWORD}" -C -Q "CREATE DATABASE testdb" | |
| env: | |
| SA_PASSWORD: ${{ secrets.SA_PASSWORD }} | |
| - name: Run tests | |
| run: npm test | |
| env: | |
| SQLONFHIR_TEST_PATH: ./sqlonfhir/tests | |
| MSSQL_HOST: localhost | |
| MSSQL_DATABASE: testdb | |
| MSSQL_USER: sa | |
| MSSQL_PASSWORD: ${{ secrets.SA_PASSWORD }} |