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

Use ast-grep GitHub action and pin versions #8275

Closed
wants to merge 7 commits into from
Closed
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
27 changes: 23 additions & 4 deletions .github/workflows/turbopack-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,29 @@ jobs:
run: |
CARGO_BUILD_TARGET="wasm32-wasip1-threads" RUSTFLAGS="-D warnings -A deprecated" cargo groups check turbopack-wasi --release

# From https://github.com/ast-grep/action/tree/v1.5/?tab=readme-ov-file#inputs
ast_grep_lint:
needs: [turbopack_rust_check]
runs-on: ubuntu-latest
name: Turbopack ast-grep lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Rust
uses: ./.github/actions/setup-rust
with:
targets: wasm32-unknown-unknown
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Set turbopack paths
run: echo "GITHUB_TURBOPACK_PATHS=$(cargo groups list turbopack | awk '{ print $2 }' | tr '\n' ' ')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: ast-grep lint step
uses: wbinnssmith/action@wbinnssmith/npm-build
with:
paths: ${{ env.GITHUB_TURBOPACK_PATHS }}
version: 0.23.0

turbopack_rust_clippy:
needs: [turbopack_rust_check]
name: Turbopack rust clippy
Expand All @@ -226,10 +249,6 @@ jobs:
run: |
RUSTFLAGS="-D warnings -A deprecated" cargo groups clippy turbopack --features rustls-tls

- name: Run ast-grep lints
run: |
npx --package @ast-grep/cli -- ast-grep scan $(cargo groups list turbopack | awk '{ print $2 }' | tr '\n' ' ')

next_dev_check:
needs: [determine_jobs]
if: needs.determine_jobs.outputs.turbopack == 'true' || needs.determine_jobs.outputs.cargo_on_main == 'true'
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/turborepo-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,28 @@ jobs:
run: |
cargo groups check turborepo-libraries --features rustls-tls

# From https://github.com/ast-grep/action/tree/v1.5/?tab=readme-ov-file#inputs
ast_grep_lint:
needs: [rust_check]
runs-on: ubuntu-latest
name: Turborepo ast-grep lint
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Turborepo Environment
uses: ./.github/actions/setup-turborepo-environment
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
- name: Set turborepo paths
run: echo "GITHUB_TURBOREPO_PATHS=$(cargo groups list turborepo | awk '{ print $2 }' | tr '\n' ' ')" >> $GITHUB_ENV
- name: Checkout
uses: actions/checkout@v4
- name: ast-grep lint step
uses: wbinnssmith/action@wbinnssmith/npm-build
with:
paths: ${{ env.GITHUB_TURBOPACK_PATHS }}
version: 0.23.0

rust_clippy:
needs: [rust_check]
name: Turborepo rust clippy
Expand All @@ -335,10 +357,6 @@ jobs:
run: |
cargo groups clippy turborepo-libraries --features rustls-tls -- --deny clippy::all

- name: Run ast-grep lints
run: |
npx --package @ast-grep/cli -- ast-grep scan $(cargo groups list turborepo-libraries | awk '{ print $2 }' | tr '\n' ' ')

rust_test:
needs: [rust_check]
strategy:
Expand Down
3 changes: 2 additions & 1 deletion .vscode/extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"windmilleng.vscode-go-autotest",
"yzhang.markdown-all-in-one",
"zxh404.vscode-proto3",
"mihaipopescu.Cram"
"mihaipopescu.Cram",
"ast-grep.ast-grep-vscode"
]
}
Loading