Skip to content

Commit

Permalink
Deliberately trigger CI workflows based on what files were changed (#…
Browse files Browse the repository at this point in the history
…2213)

* Add Readme

* Trigger more carefully

* Specifically trigger workflows
  • Loading branch information
alamb committed Jul 28, 2022
1 parent bc493d9 commit 8139f7b
Show file tree
Hide file tree
Showing 12 changed files with 70 additions and 14 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/README.md
@@ -0,0 +1,25 @@
<!---
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.
-->

The CI is structured so most tests are run in specific workflows:
`arrow.yml` for `arrow`, `parquet.yml` for `parquet` and so on.

The basic idea is to run all tests on pushes to master (to ensure we
keep master green) but run only the individual workflows on PRs that
change files that could affect them.
9 changes: 9 additions & 0 deletions .github/workflows/arrow_flight.yml
Expand Up @@ -19,8 +19,17 @@
# tests for arrow_flight crate
name: arrow_flight


# trigger for all PRs that touch certain files and changes to master
on:
push:
branches:
- master
pull_request:
paths:
- arrow/**
- arrow-flight/**
- .github/**

jobs:
# test the crate
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/cancel.yml
Expand Up @@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.

# Attempt to cancel stale workflow runs to save github actions runner time
name: Cancel stale runs

on:
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/dev.yml
Expand Up @@ -17,9 +17,11 @@

name: Dev

# trigger for all PRs and changes to master
on:
# always trigger
push:
branches:
- master
pull_request:

env:
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/dev_pr.yml
Expand Up @@ -17,6 +17,7 @@

name: Dev PR

# Trigger whenever a PR is changed (title as well as new / changed commits)
on:
pull_request_target:
types:
Expand All @@ -41,9 +42,3 @@ jobs:
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/workflows/dev_pr/labeler.yml
sync-labels: true

#- name: Checks if PR needs rebase
# uses: eps1lon/actions-label-merge-conflict@releases/2.x
# with:
# dirtyLabel: "needs-rebase"
# repoToken: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Expand Up @@ -17,8 +17,8 @@

name: Docs

# trigger for all PRs and changes to master
on:
# always trigger
push:
branches:
- master
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/integration.yml
Expand Up @@ -17,14 +17,16 @@

name: Integration

# Only run when arrow or github changes
# trigger for all PRs that touch certain files and changes to master
on:
push:
branches:
- master
pull_request:
paths:
- arrow/**
- arrow-pyarrow-integration-testing/**
- integration-testing/**
- .github/**

jobs:
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/miri.yaml
Expand Up @@ -17,12 +17,15 @@

name: MIRI

# trigger for all PRs that touch certain files and changes to master
on:
# always trigger
push:
branches:
- master
pull_request:
paths:
- arrow/**
- .github/**

jobs:
miri-checks:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/object_store.yml
Expand Up @@ -16,16 +16,16 @@
# under the License.

---
# tests for object_store crate
# tests for `object_store` crate
name: object_store

# trigger for all PRs that touch certain files and changes to master
on:
push:
branches:
- master
pull_request:
paths:
# Only run when object store files or github workflows change
- object_store/**
- .github/**

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/parquet.yml
Expand Up @@ -19,12 +19,17 @@
# tests for parquet crate
name: "parquet"


# trigger for all PRs that touch certain files and changes to master
on:
# always trigger
push:
branches:
- master
pull_request:
paths:
- arrow/**
- parquet/**
- .github/**

jobs:
# test the crate
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/parquet_derive.yml
Expand Up @@ -19,8 +19,18 @@
# tests for parquet_derive crate
name: parquet_derive


# trigger for all PRs that touch certain files and changes to master
on:
push:
branches:
- master
pull_request:
paths:
- parquet/**
- parquet_derive/**
- parquet_derive_test/**
- .github/**

jobs:
# test the crate
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/rust.yml
Expand Up @@ -15,17 +15,20 @@
# specific language governing permissions and limitations
# under the License.

# tests for workspace wide
name: Rust

# trigger for all PRs and changes to master
on:
# always trigger
push:
branches:
- master
pull_request:

jobs:

# Check workspace wide compile and test with default features for
# mac and windows
windows-and-macos:
name: Test on ${{ matrix.os }} Rust ${{ matrix.rust }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -75,6 +78,7 @@ jobs:
run: |
cargo check --benches --workspace --features test_common,prettyprint,async,experimental
# Run cargo fmt for all crates
lint:
name: Lint (cargo fmt)
runs-on: ubuntu-latest
Expand Down

0 comments on commit 8139f7b

Please sign in to comment.