build on windows first #5
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 package to PyPi | |
| on: | |
| push: | |
| jobs: | |
| download_releases: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: download release asset from deterministicGaussianSampling | |
| uses: robinraju/release-downloader@v1 | |
| with: | |
| repository: 'KIT-ISAS/deterministicGaussianSampling' | |
| latest: true | |
| fileName: '*.zip' | |
| out-file-path: 'deterministicGaussianSamplingLibs' | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: upload downloaded libs as artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: deterministicGaussianSampling-libs | |
| path: deterministicGaussianSamplingLibs | |
| test: | |
| needs: download_releases | |
| strategy: | |
| matrix: | |
| os: [windows-latest, ubuntu-latest] #, macos-latest] | |
| python-version: [3.9, 3.11] | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - name: checkout repo | |
| uses: actions/checkout@v4 | |
| - name: set up Python ${{ matrix.python-version }} | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: ${{ matrix.python-version }} | |
| - name: get deterministicGaussianSampling libs | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: deterministicGaussianSampling-libs | |
| path: external_libs | |
| - name: extract ZIP on Unix | |
| if: ${{ runner.os == 'Linux' }} | |
| run: | | |
| unzip external_libs/linux.zip -d external_libs_unpacked | |
| mkdir -p src/deterministic_gaussian_sampling/lib/linux/bin | |
| cp -r external_libs_unpacked/lib/* src/deterministic_gaussian_sampling/lib/linux/bin | |
| - name: extract ZIP on Windows | |
| if: ${{ runner.os == 'Windows' }} | |
| shell: pwsh | |
| run: | | |
| Expand-Archive -Path external_libs/windows.zip -DestinationPath external_libs_unpacked -Force | |
| New-Item -ItemType Directory -Path src\deterministic_gaussian_sampling\lib\windows\bin -Force | |
| Copy-Item external_libs_unpacked\bin\* src\deterministic_gaussian_sampling\lib\windows\bin -Recurse -Force | |
| - name: install package | |
| run: pip install -e . | |
| - name: run tests | |
| run: | | |
| pip install --upgrade pip | |
| pip install pytest | |
| pytest -v |