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

chore(IDX): cargo-filter #191

Merged
merged 7 commits into from
Jun 7, 2024
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
54 changes: 32 additions & 22 deletions .github/workflows-source/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,6 @@ anchors:
checkout: &checkout
name: Checkout
uses: actions/checkout@v4
cargo-filters: &cargo-filters
name: Filter Rust Files [*.{rs,toml,lock}]
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
if : ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
id: filter
with:
filters: |
cargo:
- "**/*.rs"
- "**/*.toml"
- "**/*.lock"
python-setup: &python-setup
name: Set up Python
uses: actions/setup-python@v2
Expand Down Expand Up @@ -373,35 +362,56 @@ jobs:
steps:
- <<: *before-script
- <<: *checkout
- <<: *cargo-filters
- name: Filter Rust Files [*.{rs,toml,lock}]
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
if : |
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
with:
filters: |
cargo:
- "**/*.rs"
- "**/*.toml"
- "**/*.lock"
- name: Run Cargo Clippy Linux
id: cargo-clippy-linux
if: steps.filter.outputs.cargo == 'true'
if: |
steps.filter.outputs.cargo == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
"$CI_PROJECT_DIR"/gitlab-ci/src/ci-scripts/rust-lint.sh
- name: No run
if: steps.filter.outputs.cargo == 'false'
run: echo "No cargo changes, skipping run"

cargo-build-release-linux:
name: Cargo Build Release Linux
<<: *dind-large-setup
timeout-minutes: 60
steps:
- <<: *before-script
- <<: *checkout
- <<: *cargo-filters
- name: Filter Rust Files [*.{rs,toml,lock}]
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
id: filter
if : |
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
with:
filters: |
cargo:
- "**/*.rs"
- "**/*.toml"
- "**/*.lock"
- name: Run Cargo Build Release Linux
id: cargo-build-release-linux
if: steps.filter.outputs.cargo == 'true'
if: |
steps.filter.outputs.cargo == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
cargo build --release
- name: No run
if: steps.filter.outputs.cargo == 'false'
run: echo "No cargo changes, skipping run"
26 changes: 15 additions & 11 deletions .github/workflows/ci-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -427,8 +427,10 @@ jobs:
uses: actions/checkout@v4
- name: Filter Rust Files [*.{rs,toml,lock}]
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
id: filter
if: |
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
with:
filters: |
cargo:
Expand All @@ -437,23 +439,23 @@ jobs:
- "**/*.lock"
- name: Run Cargo Clippy Linux
id: cargo-clippy-linux
if: steps.filter.outputs.cargo == 'true'
if: |
steps.filter.outputs.cargo == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
"$CI_PROJECT_DIR"/gitlab-ci/src/ci-scripts/rust-lint.sh
- name: No run
if: steps.filter.outputs.cargo == 'false'
run: echo "No cargo changes, skipping run"
cargo-build-release-linux:
name: Cargo Build Release Linux
runs-on:
labels: dind-runner-large
container:
image: ghcr.io/dfinity/ic-build@sha256:eb85228ebf7511e2589f86788345eb3d1c8144914a8a2fa771d4347ddacac413
if: ${{ vars.RUN_CI == 'true' }}
timeout-minutes: 60
if: ${{ vars.RUN_CI == 'true' }}
steps:
- name: Before script
if: always()
Expand All @@ -468,8 +470,10 @@ jobs:
uses: actions/checkout@v4
- name: Filter Rust Files [*.{rs,toml,lock}]
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3
if: ${{ github.event_name == 'pull_request' || github.event_name == 'merge_group' }}
id: filter
if: |
github.event_name == 'pull_request' ||
github.event_name == 'merge_group'
with:
filters: |
cargo:
Expand All @@ -478,12 +482,12 @@ jobs:
- "**/*.lock"
- name: Run Cargo Build Release Linux
id: cargo-build-release-linux
if: steps.filter.outputs.cargo == 'true'
if: |
steps.filter.outputs.cargo == 'true' ||
github.event_name == 'schedule' ||
github.event_name == 'workflow_dispatch'
shell: bash
run: |
set -eExuo pipefail
buildevents cmd "$ROOT_PIPELINE_ID" "$CI_JOB_ID" build-command -- \
cargo build --release
- name: No run
if: steps.filter.outputs.cargo == 'false'
run: echo "No cargo changes, skipping run"
Loading