Skip to content

Default CLI workspace root to cwd and generate a stable session UUID for DevTools integration OOTB #85

Default CLI workspace root to cwd and generate a stable session UUID for DevTools integration OOTB

Default CLI workspace root to cwd and generate a stable session UUID for DevTools integration OOTB #85

name: "Copilot Setup Steps"
# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
branches:
- main
paths:
- .github/workflows/copilot-setup-steps.yml
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest
# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
# If you want to clone the repository as part of your setup steps, for example to install dependencies, you'll need the `contents: read` permission. If you don't clone the repository in your setup steps, Copilot will do this for you automatically after the steps complete.
contents: read
# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v5
- uses: coursier/cache-action@v8
- name: Setup Java 21
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Verify Java version
run: java --version
- name: Setup Coursier
run: curl -fL "https://github.com/coursier/launchers/raw/master/cs-x86_64-pc-linux.gz" | gzip -d > /usr/local/bin/cs && chmod +x /usr/local/bin/cs
- name: Cache Playwright dependencies
id: cache-pw
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: playwright-${{ runner.os }}-${{ hashFiles('playwrightVersion.mill') }}
restore-keys: |
playwright-${{ runner.os }}-
- name: Install Playwright
run: cs launch com.microsoft.playwright:playwright:1.59.0 -M "com.microsoft.playwright.CLI" -- install
- name: Install binaryen
run: sudo apt-get update && sudo apt-get install -y binaryen
# Bootstrap the Mill JVM so we can update its truststore before building.
# mill-jvm-version causes Mill to download its own Adoptium JVM into the coursier
# arc cache. That JVM has its own cacerts that may be missing proxy CA certificates.
- name: Bootstrap Mill JVM
run: ./mill --no-daemon version
# Import any proxy CA certificates (e.g. mkcert) into the Mill-managed JVM truststore.
# The Mill-managed JVM lives in the coursier arc cache and has its own cacerts file
# separate from the system JVM. This step is a no-op in environments without a proxy.
- name: Trust proxy CA in Mill JVM
run: |
for cert in /etc/ssl/certs/mkcert_development_CA_*.pem; do
[ -f "$cert" ] || continue
find "$HOME/.cache/coursier/arc" -name "cacerts" -type f | while read store; do
keytool -import -noprompt -alias mkcert-dev-ca \
-file "$cert" -keystore "$store" -storepass changeit 2>/dev/null || true
done
done
# This should resolve a JVM, download dependencies and leave mill ready for use.
- name: setup mill
run: ./mill __.prepareOffline