Skip to content

Commit

Permalink
tweaks: win grpc path escape in proto / plugin cli / gunzip musl
Browse files Browse the repository at this point in the history
  • Loading branch information
YOU54F committed May 10, 2024
1 parent 4eea21f commit 9b80e21
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 36 deletions.
6 changes: 4 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ jobs:

- if: runner.os == 'Windows'
run: echo "ONLY_DOWNLOAD_PACT_FOR_WINDOWS=true" >> $GITHUB_ENV
- if: matrix.os == 'macos-14'
run: brew install protobuf

- run: LOG_LEVEL=debug ./script/ci/unpack-and-test.sh
if: ${{ matrix.docker != true }}
Expand All @@ -178,11 +180,11 @@ jobs:

- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'amd64' }}
name: test linux amd64 musl
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20-alpine bin/sh -c 'apk add bash curl gcompat shared-mime-info && cd /home && /home/script/ci/unpack-and-test.sh'
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} --rm node:20-alpine bin/sh -c 'apk add bash curl gcompat shared-mime-info file && cd /home && /home/script/ci/unpack-and-test.sh'

- if: ${{ matrix.docker == true && matrix.alpine == true && matrix.arch == 'arm64' }}
name: test linux arm64 musl
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:20-alpine bin/sh -c 'apk add bash curl libc6-compat gcompat shared-mime-info && cd /home && /home/script/ci/unpack-and-test.sh'
run: docker run -v $PWD:/home --platform linux/${{ matrix.arch }} -e SKIP_STANDALONE_TESTS --rm node:20-alpine bin/sh -c 'apk add bash curl libc6-compat gcompat shared-mime-info file && cd /home && /home/script/ci/unpack-and-test.sh'
env:
SKIP_STANDALONE_TESTS: true

Expand Down
39 changes: 6 additions & 33 deletions script/install-plugin-cli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,40 +15,12 @@ detect_osarch() {
# detect_musl
case $(uname -sm) in
'Linux x86_64')
if ldd /bin/ls >/dev/null 2>&1; then
ldd_output=$(ldd /bin/ls)
case "$ldd_output" in
*musl*)
os='linux'
arch='x86_64-musl'
;;
*)
os='linux'
arch='x86_64'
;;
esac
else
os='linux'
arch='x86_64'
fi
os='linux'
arch='x86_64'
;;
'Linux aarch64')
if ldd /bin/ls >/dev/null 2>&1; then
ldd_output=$(ldd /bin/ls)
case "$ldd_output" in
*musl*)
os='linux'
arch='aarch64-musl'
;;
*)
os='linux'
arch='aarch64'
;;
esac
else
os='linux'
arch='aarch64'
fi
os='linux'
arch='aarch64'
;;
'Darwin x86' | 'Darwin x86_64')
os='osx'
Expand Down Expand Up @@ -81,6 +53,7 @@ if [ ! -f ~/.pact/bin/pact-plugin-cli ]; then
echo " Downloading from: ${DOWNLOAD_LOCATION}"
curl -L -o ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz "${DOWNLOAD_LOCATION}"
echo " Downloaded $(file ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz)"
gunzip -N -f ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz
gunzip -f ~/.pact/bin/pact-plugin-cli-${os}-${arch}.gz
mv ~/.pact/bin/pact-plugin-cli-${os}-${arch} ~/.pact/bin/pact-plugin-cli
chmod +x ~/.pact/bin/pact-plugin-cli
fi
6 changes: 5 additions & 1 deletion test/message.integration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,11 @@ describe('FFI integration test for the Message Consumer API', () => {
(skipPluginTests ? describe.skip : describe)(
'with plugin contents (gRPC)',
() => {
const protoFile = `${__dirname}/integration/grpc/route_guide.proto`;
let protoFile = `${__dirname}/integration/grpc/route_guide.proto`;
if (process.platform === 'win32') {
const escapedProtoFile = protoFile.replace(/\\/g, '\\\\');
protoFile = escapedProtoFile;
}

let port: number;

Expand Down

0 comments on commit 9b80e21

Please sign in to comment.