Skip to content

Commit

Permalink
Streamline CI (pantsbuild#17224)
Browse files Browse the repository at this point in the history
- Unifies the code that generates the "Build wheels" jobs, so they are now uniform (with allowances for the containerization on Linux). This means in particular that we no longer bootstrap Pants on macOS11 on ARM64, as there was no particular reason to, and we weren't doing so on macOS10.15 on x86 for example.
- Uses the new classifier to skip these jobs entirely if unneeded.
- Similarly, uses the new classifier to skip rust steps if unneeded.
- Removes the steps for getting the commit message, since we no longer need it.

Now, to force a rust or wheel build even if no files were affected, you can temporarily modify a relevant file. If this becomes a hassle we can think of another way to achieve this, that doesn't involve the commit message.
  • Loading branch information
benjyw authored Oct 14, 2022
1 parent dc436bd commit 89ef823
Show file tree
Hide file tree
Showing 5 changed files with 205 additions and 767 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Cargo audit (for security vulnerabilities)
run: './cargo install --version 0.16.0 cargo-audit
Expand Down
18 changes: 0 additions & 18 deletions .github/workflows/cache_comparison.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name != 'pull_request'
name: Setup toolchain auth
run: 'echo TOOLCHAIN_AUTH_TOKEN="${{ secrets.TOOLCHAIN_AUTH_TOKEN }}" >> $GITHUB_ENV
Expand Down
130 changes: 2 additions & 128 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down Expand Up @@ -124,7 +106,7 @@ jobs:
run: './pants run build-support/bin/generate_github_workflows.py -- --check
'
- if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
- if: needs.classify_changes.outputs.rust == 'true'
name: Test and lint Rust
run: 'sudo apt-get install -y pkg-config fuse libfuse-dev
Expand Down Expand Up @@ -154,24 +136,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down Expand Up @@ -256,7 +220,7 @@ jobs:
src/python/pants/engine/internals/native_engine.so.metadata'
- env:
TMPDIR: ${{ runner.temp }}
if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
if: needs.classify_changes.outputs.rust == 'true'
name: Test Rust
run: ./cargo test --tests -- --nocapture
strategy:
Expand Down Expand Up @@ -292,24 +256,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
Expand Down Expand Up @@ -358,24 +304,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -447,24 +375,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -536,24 +446,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
Expand Down Expand Up @@ -627,24 +519,6 @@ jobs:
uses: actions/checkout@v3
with:
fetch-depth: 10
- if: github.event_name == 'push'
name: Get commit message for branch builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- if: github.event_name == 'pull_request'
name: Get commit message for PR builds
run: 'echo "COMMIT_MESSAGE<<EOF" >> $GITHUB_ENV
echo "$(git log --format=%B -n 1 HEAD^2)" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
'
- name: Install AdoptJDK
uses: actions/setup-java@v3
with:
Expand Down
Loading

0 comments on commit 89ef823

Please sign in to comment.