Skip to content

Commit

Permalink
fix windows build (test)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssddOnTop committed May 24, 2024
1 parent b0ee0b3 commit e1ad664
Showing 1 changed file with 33 additions and 22 deletions.
55 changes: 33 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,28 @@ jobs:
- name: Build
run: cargo lambda build

test_cf:
test_wasm:
name: Run Tests (WASM)
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tailcall-wasm
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: wasm32-unknown-unknown

- name: Install Wasm Pack
run: cargo install wasm-bindgen-cli --vers "0.2.92"

- name: Test WASM
run: cargo test

test_cf:
name: Run Tests (Cloudflare)
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./tailcall-cloudflare
Expand All @@ -73,9 +92,6 @@ jobs:
with:
target: wasm32-unknown-unknown

- name: Build WASM
run: cargo check --lib --target wasm32-unknown-unknown
working-directory: ./tailcall-cloudflare
- name: Install Node.js
uses: actions/setup-node@v4
with:
Expand Down Expand Up @@ -230,7 +246,7 @@ jobs:
# TODO: move to separate file to separate responsibilities
release:
name: Release
needs: [test, draft_release, check_if_build, test_cf]
needs: [test, draft_release, check_if_build, test_cf, test_wasm]
# TODO: put a condition to separate job that other will depend on to remove duplication?
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && (needs.check_if_build.outputs.check_if_build == 'true')
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -343,6 +359,10 @@ jobs:
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
target: ${{ matrix.target }}
- name: Install dependencies on Windows
if: runner.os == 'Windows'
run: |
choco install nasm -y
- name: Build
env:
Expand Down Expand Up @@ -473,28 +493,19 @@ jobs:
with:
node-version: 20.11.0
registry-url: https://registry.npmjs.org
- name: Setup .npmrc file to publish to npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
- name: Install dependencies
run: |
cd npm
cd tailcall-wasm
npm install
- name: Run generate-root.js script
- name: Run publish script
env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
run: |
cd npm
npm run gen-root -- --version ${{ env.APP_VERSION }}
- name: Setup .npmrc file to publish to npm
run: echo "//registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN" > ~/.npmrc
- name: Publish packages
uses: JS-DevTools/npm-publish@v3
with:
token: ${{ secrets.NPM_TOKEN }}
package: npm/@tailcallhq/tailcall
access: public

env:
APP_VERSION: ${{needs.draft_release.outputs.create_release_name }}
APP_VERSION: ${{ needs.draft_release.outputs.create_release_name }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
cd tailcall-wasm
npm run publish
build-and-push-image:
env:
Expand Down

0 comments on commit e1ad664

Please sign in to comment.