Skip to content
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

Run CI for branch builds with GitHub Actions #11747

Merged
merged 4 commits into from
Mar 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/audit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV

'
- name: Test and Lint Rust
- name: Cargo audit (for security vulnerabilities)
run: './cargo install --version 0.13.1 cargo-audit

./cargo audit
Expand Down
69 changes: 35 additions & 34 deletions .github/workflows/test-cron.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ jobs:
'
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: './pants --version

Expand All @@ -102,29 +100,25 @@ jobs:

./pants help targets

./pants help subsystems

'
- name: Upload native_engine.so
uses: actions/upload-artifact@v2
with:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata'
- if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
name: Test and Lint Rust
run: 'sudo apt-get install -y pkg-config fuse libfuse-dev

./cargo clippy --all

# We pass --tests to skip doc tests because our generated protos contain invalid

# doc tests in their comments.

./cargo test --all --tests -- --nocapture

'
- name: Upload native_engine.so
uses: actions/upload-artifact@v2
with:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
strategy:
matrix:
python-version:
Expand Down Expand Up @@ -211,9 +205,7 @@ jobs:
'
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: './pants --version

Expand All @@ -224,31 +216,20 @@ jobs:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- env:
TMPDIR: ${{ runner.temp }}
if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
name: Test Rust
run: '# We pass --tests to skip doc tests because our generated protos contain
invalid

# doc tests in their comments.

# We do not pass --all as BRFS tests don''t pass on GHA MacOS containers.

./cargo test --tests -- --nocapture

'
run: ./cargo test --tests -- --nocapture
strategy:
matrix:
python-version:
- 3.8.3
lint_python_linux:
lint_python:
env:
PANTS_CONFIG_FILES: +['pants.ci.toml', 'pants.remote-cache.toml']
name: Lint Python (Linux)
name: Lint Python
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -371,6 +352,26 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
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@v2
with:
Expand Down
73 changes: 38 additions & 35 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,7 @@ jobs:
'
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: './pants --version

Expand All @@ -102,29 +100,25 @@ jobs:

./pants help targets

./pants help subsystems

'
- name: Upload native_engine.so
uses: actions/upload-artifact@v2
with:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata'
- if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
name: Test and Lint Rust
run: 'sudo apt-get install -y pkg-config fuse libfuse-dev

./cargo clippy --all

# We pass --tests to skip doc tests because our generated protos contain invalid

# doc tests in their comments.

./cargo test --all --tests -- --nocapture

'
- name: Upload native_engine.so
uses: actions/upload-artifact@v2
with:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
strategy:
matrix:
python-version:
Expand Down Expand Up @@ -211,9 +205,7 @@ jobs:
'
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- name: Bootstrap Pants
run: './pants --version

Expand All @@ -224,31 +216,20 @@ jobs:
name: native_engine.so.${{ matrix.python-version }}.${{ runner.os }}
path: 'src/python/pants/engine/internals/native_engine.so

src/python/pants/engine/internals/native_engine.so.metadata

'
src/python/pants/engine/internals/native_engine.so.metadata'
- env:
TMPDIR: ${{ runner.temp }}
if: '!contains(env.COMMIT_MESSAGE, ''[ci skip-rust]'')'
name: Test Rust
run: '# We pass --tests to skip doc tests because our generated protos contain
invalid

# doc tests in their comments.

# We do not pass --all as BRFS tests don''t pass on GHA MacOS containers.

./cargo test --tests -- --nocapture

'
run: ./cargo test --tests -- --nocapture
strategy:
matrix:
python-version:
- 3.7.10
lint_python_linux:
lint_python:
env:
PANTS_CONFIG_FILES: +['pants.ci.toml', 'pants.remote-cache.toml']
name: Lint Python (Linux)
name: Lint Python
needs: bootstrap_pants_linux
runs-on: ubuntu-20.04
steps:
Expand Down Expand Up @@ -371,6 +352,26 @@ jobs:
steps:
- name: Check out code
uses: actions/checkout@v2
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@v2
with:
Expand Down Expand Up @@ -401,4 +402,6 @@ jobs:
python-version:
- 3.7.10
name: Pull Request CI
'on': pull_request
'on':
- push
- pull_request
Loading