Bump actions/checkout from 3 to 4 #95
Workflow file for this run
This file contains 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
# Copyright 2022-2023 Sutou Kouhei <[email protected]> | |
# | |
# Licensed 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: CI | |
on: | |
- push | |
- pull_request | |
concurrency: | |
group: ${{ github.repository }}-${{ github.head_ref || github.sha }}-${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
rat: | |
name: Release Audit Tool (RAT) | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
path: datafusion-c | |
- name: Checkout Arrow | |
uses: actions/checkout@v4 | |
with: | |
path: arrow | |
repository: apache/arrow | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.x" | |
- name: Setup Archery | |
run: | | |
pip install -e arrow/dev/archery[lint] | |
- name: Run RAT | |
run: | | |
cd datafusion-c && archery lint --rat | |
lint: | |
name: Lint | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions-rs/toolchain@v1 | |
id: rust-toolchain | |
with: | |
components: rustfmt, clippy | |
override: true | |
toolchain: stable | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo | |
key: cargo-lint-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('Cargo.lock') }} | |
- name: Check format | |
uses: actions-rs/cargo@v1 | |
with: | |
command: fmt | |
args: --all -- --check | |
- name: Run Clippy | |
uses: actions-rs/cargo@v1 | |
with: | |
command: clippy | |
args: --all-targets --all-features -- -D clippy::all -D warnings | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: "lts/*" | |
- name: Prettier | |
run: | | |
npx prettier --check "**.md" | |
test: | |
name: Test | |
strategy: | |
fail-fast: false | |
matrix: | |
runs-on: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
runs-on: ${{ matrix.runs-on }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
if: | | |
matrix.runs-on != 'windows-latest' | |
with: | |
python-version: '3.x' | |
- name: Prepare on Ubuntu | |
if: | | |
matrix.runs-on == 'ubuntu-latest' | |
run: | | |
sudo apt update | |
sudo apt install -y -V \ | |
ca-certificates \ | |
lsb-release \ | |
wget | |
wget https://apache.jfrog.io/artifactory/arrow/$(lsb_release --id --short | tr 'A-Z' 'a-z')/apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
sudo apt install -y -V \ | |
./apache-arrow-apt-source-latest-$(lsb_release --codename --short).deb | |
sudo apt update | |
sudo apt install -y -V \ | |
libarrow-glib-dev \ | |
libgirepository1.0-dev \ | |
libparquet-glib-dev \ | |
ninja-build \ | |
valac | |
pip install meson | |
echo "GI_TYPELIB_PATH=${HOME}/local/lib/girepository-1.0" >> ${GITHUB_ENV} | |
echo "LD_LIBRARY_PATH=${PWD}/build:${HOME}/local/lib:${LD_LIBRARY_PATH}" >> ${GITHUB_ENV} | |
- name: Prepare on macOS | |
if: | | |
matrix.runs-on == 'macos-latest' | |
run: | | |
brew update --preinstall | |
brew bundle --file=Brewfile | |
echo "DYLD_LIBRARY_PATH=${PWD}/build:${HOME}/local/lib:${DYLD_LIBRARY_PATH}" >> ${GITHUB_ENV} | |
echo "GI_TYPELIB_PATH=${HOME}/local/lib/girepository-1.0" >> ${GITHUB_ENV} | |
echo "XML_CATALOG_FILES=$(brew --prefix)/etc/xml/catalog" >> ${GITHUB_ENV} | |
# - name: Prepare on Windows | |
# if: | | |
# matrix.runs-on == 'windows-latest' | |
# run: | | |
# pip install meson | |
- uses: ruby/setup-ruby@v1 | |
if: | | |
matrix.runs-on != 'windows-latest' | |
with: | |
ruby-version: "3.1" | |
bundler-cache: true | |
- uses: actions-rs/toolchain@v1 | |
id: rust-toolchain | |
with: | |
override: true | |
toolchain: stable | |
- name: Cache Cargo | |
uses: actions/cache@v3 | |
with: | |
path: ~/.cargo | |
key: cargo-test-${{ matrix.runs-on }}-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.toml') }} | |
- name: Install cargo-c | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: cargo-c | |
- name: Setup on non-Windows | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
meson setup \ | |
--libdir=lib \ | |
--prefix=${HOME}/local \ | |
-Dvapi=${{ matrix.runs-on == 'ubuntu-latest' }} \ | |
-Dwerror=true \ | |
build \ | |
. | |
- name: Build on non-Windows | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
ninja -C build | |
- name: Build on Windows | |
if: | | |
matrix.runs-on == 'windows-latest' | |
uses: actions-rs/cargo@v1 | |
with: | |
command: cbuild | |
- name: Test | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
cd build | |
bundle exec ../test/run.sh | |
- name: Install | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
ninja -C build install | |
- name: Run C example | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
build/example/sql-c | |
- name: Run Python example | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
cd build | |
../example/sql.py | |
- name: Run Ruby example | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
cd build | |
../example/sql.rb | |
- name: Run GLib C example | |
if: | | |
matrix.runs-on != 'windows-latest' | |
run: | | |
build/example/sql-glib-c | |
- name: Run GLib Vala example | |
if: | | |
matrix.runs-on == 'ubuntu-latest' | |
run: | | |
build/example/sql-glib-vala | |
- name: Run GLib Python example | |
if: | | |
matrix.runs-on == 'ubuntu-latest' | |
run: | | |
pip install PyGObject | |
example/sql-glib.py | |
- name: Run GLib Ruby example | |
if: | | |
matrix.runs-on == 'ubuntu-latest' | |
run: | | |
bundle exec example/sql-glib.rb |