Skip to content

Commit ceff46f

Browse files
authored
Merge pull request #38 from datafusion-contrib/add-github-pipelines
Add basic Github pipelines
2 parents ae8d2bb + c33711d commit ceff46f

File tree

4 files changed

+146
-44
lines changed

4 files changed

+146
-44
lines changed

.github/actions/setup/action.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Setup
2+
description: Setup environment for CI
3+
4+
inputs:
5+
targets:
6+
description: Comma-separated list of target triples to install for this toolchain
7+
required: false
8+
components:
9+
description: Comma-separated list of components to be additionally installed
10+
required: false
11+
12+
runs:
13+
using: 'composite'
14+
steps:
15+
- shell: bash
16+
run: |
17+
echo $HOME
18+
echo ${{ runner.os }}
19+
20+
- name: Cache APT packages
21+
if: runner.os == 'Linux'
22+
uses: actions/cache@v4
23+
with:
24+
path: |
25+
/var/cache/apt/archives
26+
/var/lib/apt/lists
27+
key: ${{ runner.os }}-apt-${{ hashFiles('.github/actions/setup/apt-packages.txt') }}
28+
restore-keys: |
29+
${{ runner.os }}-apt-
30+
31+
- name: Update and install APT packages
32+
if: runner.os == 'Linux'
33+
shell: bash
34+
run: |
35+
sudo apt-get update
36+
xargs -a .github/actions/setup/apt-packages.txt sudo apt-get install -y
37+
38+
- uses: dtolnay/rust-toolchain@stable
39+
with:
40+
toolchain: stable
41+
targets: ${{ inputs.targets }}
42+
components: ${{ inputs.components }}
43+
44+
- uses: Swatinem/rust-cache@v2
45+
with:
46+
key: ${{ runner.os }}-${{ inputs.targets }}-rust-cache
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
protobuf-compiler

.github/workflows/ci.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
env:
10+
CARGO_TERM_COLOR: always
11+
RUST_BACKTRACE: 1
12+
13+
concurrency:
14+
group: ${{ github.ref }}
15+
cancel-in-progress: true
16+
17+
jobs:
18+
clippy:
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- uses: ./.github/actions/setup
23+
with:
24+
components: clippy
25+
- run: cargo clippy
26+
27+
unit-test:
28+
runs-on: ubuntu-latest
29+
steps:
30+
- uses: actions/checkout@v4
31+
- uses: ./.github/actions/setup
32+
- run: cargo test
33+
34+
format-check:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v4
38+
- uses: ./.github/actions/setup
39+
with:
40+
components: rustfmt
41+
- run: cargo fmt --all -- --check

0 commit comments

Comments
 (0)