Server to/fro implementation with composable models, routes, mocks/fakes #69
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: CI | |
| on: | |
| push: | |
| branches: [ master, main ] | |
| tags: [ 'v*' ] | |
| pull_request: | |
| branches: [ master, main ] | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - name: Set up Python | |
| uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.11' | |
| - name: Checkout Test Harness | |
| uses: actions/checkout@v7 | |
| with: | |
| repository: SamuelMarks/cdd-openapi-test-harness | |
| path: cdd-openapi-test-harness | |
| - name: Install dependencies | |
| run: | | |
| pip install uv | |
| make install_deps | |
| - name: Run pre-commit hooks | |
| env: | |
| TEST_HARNESS_DIR: ${{ github.workspace }}/cdd-openapi-test-harness | |
| run: | | |
| uv tool install pre-commit --with pre-commit-uv | |
| pre-commit run --all-files | |
| - name: Test | |
| run: make test | |
| - name: Build | |
| run: make build | |
| - name: Install binaryen | |
| run: sudo apt-get update && sudo apt-get install -y binaryen | |
| - name: Build WASM | |
| run: | | |
| make build_wasm | |
| for f in bin/*.wasm; do | |
| if [ -f "$f" ]; then | |
| wasm-opt -O3 "$f" -o "$f" || true | |
| cp "$f" dist/ | |
| fi | |
| done | |
| - name: Upload Build Artifacts | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: python-build | |
| path: dist/ | |
| release: | |
| needs: build | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| - uses: actions/download-artifact@v8 | |
| with: | |
| name: python-build | |
| path: dist/ | |
| - name: Release version tag | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| files: dist/**/* | |
| - name: Update latest release | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release delete latest --cleanup-tag -y || true | |
| git config user.name "github-actions[bot]" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git tag -fa latest -m "Update latest tag to ${{ github.ref_name }}" | |
| git push origin latest --force | |
| files=() | |
| while IFS= read -r -d '' file; do | |
| files+=("$file") | |
| done < <(find dist -type f -print0) | |
| if [ ${#files[@]} -gt 0 ]; then | |
| gh release create latest "${files[@]}" --title "latest" --notes "Latest release mirrored from ${{ github.ref_name }}" | |
| else | |
| gh release create latest --title "latest" --notes "Latest release mirrored from ${{ github.ref_name }}" | |
| fi |