Skip to content

Commit

Permalink
add ci check for windows executable
Browse files Browse the repository at this point in the history
  • Loading branch information
tatethurston committed Dec 28, 2024
1 parent b65802c commit 2541bd7
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 29 deletions.
52 changes: 36 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,18 @@ on:
- main
pull_request:
jobs:
ci:
name: "Lint and Test"
lint_test:
name: Lint and Test
runs-on: ubuntu-latest
steps:
# Install protoc for e2e:setup
- uses: arduino/setup-protoc@v2
with:
version: "23.4"
- uses: bufbuild/buf-setup-action@v1.25.0
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
with:
node-version-file: ".nvmrc"
cache: "pnpm"
- run: pnpm install --frozen-lockfile
- run: (cd packages/twirpscript && pnpm package:build)
# run again to link bin that is now available after package:build
- run: pnpm install --frozen-lockfile
- run: pnpm lint
- run: pnpm test:ci && pnpm codecov --token=$CODECOV_TOKEN
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
- uses: tatethurston/github-actions/test@main
with:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
- name: Check for uncommited changes to generated files
run: |
pnpm regen
Expand All @@ -40,3 +29,34 @@ jobs:
echo "Failing build."
exit 1
fi
build_package:
name: Build Package
runs-on: ubuntu-latest
outputs:
package-name: package-${{ github.event.pull_request.number }}
steps:
- uses: tatethurston/github-actions/build@main
- name: NPM Pack
run: |
cd packages/twirpscript
pnpm pack
- uses: actions/upload-artifact@v4
with:
name: package-${{ github.event.pull_request.number }}
path: packages/twirpscript/*.tgz
if-no-files-found: error
retention-days: 1
overwrite: true
check_windows:
name: Windows CI Check
runs-on: windows-latest
needs: build_package
steps:
- uses: actions/download-artifact@v4
with:
name: ${{ needs.build_package.outputs.package-name }}
- uses: actions/setup-node@v3
- name: Bin Check
run: |
npm install *.tgz
npm twirpscript
17 changes: 5 additions & 12 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
name: Publish NPM Package
on:
release:
types: [created]
types: [published]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
- uses: actions/setup-node@v3
- uses: tatethurston/github-actions/publish@main
with:
node-version-file: ".nvmrc"
cache: "pnpm"
registry-url: "https://registry.npmjs.org"
- run: pnpm install --frozen-lockfile
- run: cp README.md LICENSE CHANGELOG.md packages/twirpscript
- run: cd packages/twirpscript && pnpm package:build && npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
package_directory: packages/twirpscript
npm_token: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
},
"type": "module",
"scripts": {
"build": "(pnpm package:copy:files && cd packages/twirpscript && pnpm package:build)",
"package:copy:files": "cp ./LICENSE ./README.md packages/twirpscript",
"e2e:regen": "pnpm --filter './e2e/*' exec twirpscript",
"examples:buf:regen": "(cd examples/buf && buf generate)",
"examples:regen": "pnpm examples:buf:regen && for f in examples/*; do if [ $f != examples/buf ]; then (cd $f; pnpm twirpscript); fi; done",
Expand All @@ -17,7 +19,8 @@
"prepare": "husky install",
"regen": "pnpm examples:regen && pnpm e2e:regen",
"test": "jest",
"test:ci": "jest examples/* packages/* --coverage",
"//": "pnpm install again to link bin that is now available after package:build",
"test:ci": "pnpm install --frozen-lockfile && jest examples/* packages/* --coverage",
"test:integration": "pnpm run test-protos && pnpm run test-clientcompat",
"test-clientcompat": "(cd ./src/integration-tests/clientcompat && pnpm run build && npx twirpscript)",
"test-protos": "(cd src/integration-tests/protos && pnpm run build && pnpm run typecheck:protos)",
Expand Down

0 comments on commit 2541bd7

Please sign in to comment.