From a47cbbca9d6febd115931a5e222b15e65f751a3a Mon Sep 17 00:00:00 2001 From: Copilot <198982749+Copilot@users.noreply.github.com> Date: Fri, 1 Aug 2025 10:58:36 +0800 Subject: [PATCH] ci: add GitHub Copilot agent environment setup workflow (#12700) --- .github/workflows/copilot-setup-steps.yml | 78 +++++++++++++++++++++++ AGENTS.md | 1 + 2 files changed, 79 insertions(+) create mode 100644 .github/workflows/copilot-setup-steps.yml diff --git a/.github/workflows/copilot-setup-steps.yml b/.github/workflows/copilot-setup-steps.yml new file mode 100644 index 0000000000..9e60440c31 --- /dev/null +++ b/.github/workflows/copilot-setup-steps.yml @@ -0,0 +1,78 @@ +name: Copilot Setup Steps + +# This workflow defines the setup steps that GitHub Copilot agents will use +# to prepare the development environment for the oxc project. +# It preinstalls tools and dependencies needed for Rust and Node.js development. + +on: + workflow_dispatch: + pull_request: + types: [opened, synchronize] + paths: + - .github/workflows/copilot-setup-steps.yml + push: + branches: + - main + paths: + - .github/workflows/copilot-setup-steps.yml + +permissions: {} + +jobs: + setup: + name: Setup Development Environment for Copilot + runs-on: ubuntu-latest + steps: + # Checkout full repo for git history. + - uses: actions/checkout@v4 + with: + persist-credentials: false + + - uses: oxc-project/setup-rust@cd82e1efec7fef815e2c23d296756f31c7cdc03d # v1.0.0 + with: + cache-key: copilot + save-cache: ${{ github.ref_name == 'main' }} + tools: just,watchexec-cli,cargo-insta,typos-cli,cargo-shear,dprint + + - uses: oxc-project/setup-node@f42e3bda950c7454575e78ee4eaac880a077700c # v1.0.0 + + - name: Verify installations + run: | + echo "=== Rust toolchain ===" + rustc --version + cargo --version + + echo "=== Node.js and pnpm ===" + node --version + pnpm --version + + echo "=== Command runner ===" + just --version + + echo "=== Development tools ===" + watchexec --version + cargo insta --version + typos --version + cargo shear --version + dprint --version + + echo "=== Project commands ===" + just --list + + - name: Setup complete + run: | + echo "🎉 Development environment setup complete!" + echo "The following tools are now available:" + echo " - Rust toolchain (version from rust-toolchain.toml)" + echo " - Node.js and pnpm (versions from .node-version and" + echo " package.json)" + echo " - just command runner" + echo " - Development tools: watchexec, cargo-insta, typos," + echo " cargo-shear, dprint" + echo " - All Node.js dependencies installed" + echo "" + echo "You can now use 'just' commands to work with the project:" + echo " - just ready # Run all checks" + echo " - just fmt # Format code" + echo " - just test # Run tests" + echo " - just lint # Run linting" diff --git a/AGENTS.md b/AGENTS.md index 47bbd73be4..3db8b71dce 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -68,6 +68,7 @@ just check # Check code without building just test # Run tests just lint # Run linting just doc # Generate documentation +just ast # When directory `crates/oxc_ast` changes ``` ### Building and Testing