-
Notifications
You must be signed in to change notification settings - Fork 17
GH-3: Enable CI #17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
GH-3: Enable CI #17
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6cc928c
GH-3: Enable CI
raulcd 38ef4f8
Minor improvements + add .env file
raulcd 97c6307
Try fixing macOS build
raulcd 42ed6bd
Try fixing eslint-plugin-gunicorn on macos
raulcd a4c8205
Minor fixes and use /tmp/build instead of internal dir
raulcd 27ae089
Remove possibly unnecessary check for eslint-plugin-unicorn and fix c…
raulcd 095d671
Reduce unnecessary long timeout
raulcd a8858b1
Remove stray comment from tests
raulcd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| # All of the following environment variables are required to set default values | ||
| # for the parameters in docker-compose.yml. | ||
|
|
||
| # empty prefix means that the docker-compose configuration will use named | ||
| # volumes which potentially improves the performance on docker for macos and | ||
| # docker for windows, it also prevents the contamination of the source | ||
| # directory | ||
| # a non-empty prefix means that directories from the host are bind-mounted | ||
| # into the container, it should be set to ".docker/" on github actions to keep | ||
| # the cache plugin functional | ||
| DOCKER_VOLUME_PREFIX= | ||
|
|
||
| # turn on inline build cache, this is a docker buildx feature documented | ||
| # at https://github.com/docker/buildx#--cache-tonametypetypekeyvalue | ||
| BUILDKIT_INLINE_CACHE=1 | ||
| COMPOSE_DOCKER_CLI_BUILD=1 | ||
| DOCKER_BUILDKIT=1 | ||
|
|
||
| # different architecture notations | ||
| ARCH=amd64 | ||
| ARCH_ALIAS=x86_64 | ||
| ARCH_SHORT=amd64 | ||
|
|
||
| # The default Debian version to use for the docker image | ||
| DEBIAN=12 | ||
|
|
||
| # Default repository to pull and push images from | ||
| REPO=ghcr.io/apache/arrow-js-dev | ||
|
|
||
| # Default versions for various dependencies | ||
| NODE=18 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,116 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| name: NodeJS | ||
|
|
||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - '**' | ||
| - '!dependabot/**' | ||
| tags: | ||
| - '**' | ||
| pull_request: | ||
|
|
||
| concurrency: | ||
| group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| DOCKER_VOLUME_PREFIX: ".docker/" | ||
|
|
||
| jobs: | ||
|
|
||
| docker: | ||
| name: AMD64 Debian 12 NodeJS 18 | ||
| runs-on: ubuntu-latest | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - name: Checkout Arrow JS | ||
| uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Execute Docker Build | ||
| run: | | ||
| docker compose run debian-js | ||
|
|
||
| macos: | ||
| name: AMD64 macOS 13 NodeJS ${{ matrix.node }} | ||
| runs-on: macos-13 | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: [18] | ||
| steps: | ||
| - name: Checkout Arrow JS | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Jest Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .jest-cache | ||
| key: js-jest-cache-${{ runner.os }}-${{ hashFiles('src/**/*.ts', 'test/**/*.ts', 'yarn.lock') }} | ||
| restore-keys: js-jest-cache-${{ runner.os }}- | ||
| - name: Install NodeJS | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| - name: Build | ||
| shell: bash | ||
| run: ci/scripts/js_build.sh $(pwd) /tmp/build | ||
| - name: Test | ||
| shell: bash | ||
| run: ci/scripts/js_test.sh /tmp/build | ||
|
|
||
| windows: | ||
| name: AMD64 Windows NodeJS ${{ matrix.node }} | ||
| runs-on: windows-latest | ||
| if: ${{ !contains(github.event.pull_request.title, 'WIP') }} | ||
| timeout-minutes: 45 | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: [18] | ||
| steps: | ||
| - name: Checkout Arrow JS | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - name: Jest Cache | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: .jest-cache | ||
| key: js-jest-cache-${{ runner.os }}-${{ hashFiles('src/**/*.ts', 'test/**/*.ts', 'yarn.lock') }} | ||
| restore-keys: js-jest-cache-${{ runner.os }}- | ||
| - name: Install NodeJS | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| - name: Build | ||
| shell: bash | ||
| run: ci/scripts/js_build.sh $(pwd) /tmp/build | ||
| - name: Test | ||
| shell: bash | ||
| run: ci/scripts/js_test.sh /tmp/build |
Empty file.
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| ARG arch=amd64 | ||
| ARG node=18 | ||
| FROM ${arch}/node:${node} | ||
|
|
||
| ENV NODE_NO_WARNINGS=1 | ||
|
|
||
| # install rsync for copying the generated documentation | ||
| RUN apt-get update -y -q && \ | ||
| apt-get install -y -q --no-install-recommends rsync && \ | ||
| apt-get clean && \ | ||
| rm -rf /var/lib/apt/lists/* |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set -ex | ||
|
|
||
| source_dir=${1} | ||
| build_dir=${2} | ||
|
|
||
| : ${BUILD_DOCS_JS:=OFF} | ||
|
|
||
| # https://github.com/apache/arrow/issues/41429 | ||
| # TODO: We want to out-of-source build. This is a workaround. We copy | ||
| # all needed files to the build directory from the source directory | ||
| # and build in the build directory. | ||
| rm -rf ${build_dir}/js | ||
| mkdir -p ${build_dir} | ||
|
|
||
| cp -aL ${source_dir}/LICENSE.txt ${build_dir}/ | ||
| cp -aL ${source_dir}/NOTICE.txt ${build_dir}/ | ||
| cp -aL ${source_dir} ${build_dir}/js | ||
| pushd ${build_dir}/js | ||
|
|
||
| yarn --immutable | ||
|
|
||
| yarn lint:ci | ||
| yarn build | ||
|
|
||
| if [ "${BUILD_DOCS_JS}" == "ON" ]; then | ||
| # If apache or upstream are defined use those as remote. | ||
| # Otherwise use origin which could be a fork on PRs. | ||
| if [ "$(git -C ${source_dir} config --get remote.apache.url)" == "git@github.com:apache/arrow-js.git" ]; then | ||
| yarn doc --gitRemote apache | ||
| elif [[ "$(git -C ${source_dir}config --get remote.upstream.url)" =~ "https://github.com/apache/arrow-js" ]]; then | ||
| yarn doc --gitRemote upstream | ||
| elif [[ "$(basename -s .git $(git -C ${source_dir} config --get remote.origin.url))" == "arrow-js" ]]; then | ||
| yarn doc | ||
| else | ||
| echo "Failed to build docs because the remote is not set correctly. Please set the origin or upstream remote to https://github.com/apache/arrow-js.git or the apache remote to git@github.com:apache/arrow-js.git." | ||
| exit 0 | ||
| fi | ||
| mkdir -p ${build_dir}/docs/js | ||
| rsync -a doc/ ${build_dir}/docs/js | ||
| fi | ||
|
|
||
| popd |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # Licensed to the Apache Software Foundation (ASF) under one | ||
| # or more contributor license agreements. See the NOTICE file | ||
| # distributed with this work for additional information | ||
| # regarding copyright ownership. The ASF licenses this file | ||
| # to you under the Apache License, Version 2.0 (the | ||
| # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||
| # | ||
| # Unless required by applicable law or agreed to in writing, | ||
| # software distributed under the License is distributed on an | ||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
| # KIND, either express or implied. See the License for the | ||
| # specific language governing permissions and limitations | ||
| # under the License. | ||
|
|
||
| set -ex | ||
|
|
||
| build_dir=${1}/js | ||
|
|
||
| pushd ${build_dir} | ||
|
|
||
| yarn lint | ||
| yarn test | ||
| yarn test:bundle | ||
|
|
||
| popd |
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
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,54 @@ | ||||||||||
| # Licensed to the Apache Software Foundation (ASF) under one | ||||||||||
| # or more contributor license agreements. See the NOTICE file | ||||||||||
| # distributed with this work for additional information | ||||||||||
| # regarding copyright ownership. The ASF licenses this file | ||||||||||
| # to you under the Apache License, Version 2.0 (the | ||||||||||
| # "License"); you may not use this file except in compliance | ||||||||||
| # with the License. You may obtain a copy of the License at | ||||||||||
| # | ||||||||||
| # http://www.apache.org/licenses/LICENSE-2.0 | ||||||||||
| # | ||||||||||
| # Unless required by applicable law or agreed to in writing, | ||||||||||
| # software distributed under the License is distributed on an | ||||||||||
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||||||||||
| # KIND, either express or implied. See the License for the | ||||||||||
| # specific language governing permissions and limitations | ||||||||||
| # under the License. | ||||||||||
|
|
||||||||||
| # Usage | ||||||||||
| # ----- | ||||||||||
| # | ||||||||||
| # The docker compose file is parametrized using environment variables, the | ||||||||||
| # defaults are set in .env file. | ||||||||||
| # | ||||||||||
| # Example: | ||||||||||
| # $ ARCH=amd64 docker compose build debian-js | ||||||||||
| # $ ARCH=amd64 docker compose run debian-js | ||||||||||
|
|
||||||||||
| volumes: | ||||||||||
| debian-ccache: | ||||||||||
| name: ${ARCH}-debian-${DEBIAN}-ccache | ||||||||||
|
Comment on lines
+29
to
+30
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We don't need to use
Suggested change
|
||||||||||
|
|
||||||||||
| services: | ||||||||||
| debian-js: | ||||||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
| # Usage: | ||||||||||
| # docker compose build debian-js | ||||||||||
| # docker compose run debian-js | ||||||||||
| image: ${REPO}:${ARCH}-debian-${DEBIAN}-js-${NODE} | ||||||||||
| build: | ||||||||||
| context: . | ||||||||||
| dockerfile: ci/docker/debian-${DEBIAN}-js.dockerfile | ||||||||||
| cache_from: | ||||||||||
| - ${REPO}:${ARCH}-debian-${DEBIAN}-js-${NODE} | ||||||||||
| args: | ||||||||||
| arch: ${ARCH} | ||||||||||
| node: ${NODE} | ||||||||||
| volumes: &debian-volumes | ||||||||||
| - .:/arrow-js:delegated | ||||||||||
| - ${DOCKER_VOLUME_PREFIX}debian-ccache:/ccache:delegated | ||||||||||
| environment: | ||||||||||
| BUILD_DOCS_JS: "ON" | ||||||||||
| command: &js-command > | ||||||||||
| /bin/bash -c " | ||||||||||
| /arrow-js/ci/scripts/js_build.sh /arrow-js /build && | ||||||||||
| /arrow-js/ci/scripts/js_test.sh /build" | ||||||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you use recommended
compose.yaml(not.yml) file name for Docker Compose v2?See also: https://docs.docker.com/compose/gettingstarted/#step-2-define-services-in-a-compose-file