Skip to content

Add the native Stack language server #44

Add the native Stack language server

Add the native Stack language server #44

Workflow file for this run

name: CI
on:
pull_request:
push:
branches:
- main
permissions:
contents: read
jobs:
baseline:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Read supported specification revision
id: specification
shell: bash
run: |
grep -Eq '^[0-9a-f]{40}$' tests/specification-revision
revision=$(tr -d '\n' < tests/specification-revision)
printf 'revision=%s\n' "$revision" >> "$GITHUB_OUTPUT"
- name: Check out canonical specification
uses: actions/checkout@v7
with:
repository: stack-sh/specification
ref: ${{ steps.specification.outputs.revision }}
path: .stack-specification
- name: Check whitespace
run: git diff --check "$(git hash-object -t tree /dev/null)" HEAD
- name: Validate provider catalogs
run: node scripts/validate-provider-catalogs.mjs
- name: Validate distribution contract
run: |
node scripts/validate-distribution-contract.mjs
node --test scripts/distribution-contract.test.mjs scripts/aqua-registry.test.mjs
- name: Install Aqua for registry validation
uses: aquaproj/aqua-installer@96a9bc20066c5bf5e275b41019cfc165b25f4e2e # v4.0.5
with:
aqua_version: v2.62.3
enable_aqua_install: false
- name: Validate Aqua release mappings
env:
AQUA_CONFIG: ${{ github.workspace }}/tests/aqua/aqua.yaml
AQUA_POLICY_CONFIG: ${{ github.workspace }}/tests/aqua/aqua-policy.yaml
run: |
aqua update
aqua update-checksum
git diff --exit-code -- tests/aqua/aqua-checksums.json tests/aqua/aqua.yaml
for environment in darwin/amd64 darwin/arm64 linux/amd64 linux/arm64; do
root="$RUNNER_TEMP/aqua-${environment//\//-}"
AQUA_ROOT_DIR="$root" AQUA_GOOS="${environment%/*}" AQUA_GOARCH="${environment#*/}" aqua install --test
done
native_root="$RUNNER_TEMP/aqua-native"
smoke_directory="$RUNNER_TEMP/aqua-smoke"
mkdir -p "$smoke_directory"
AQUA_ROOT_DIR="$native_root" aqua install
"$native_root/bin/stack" --version
"$native_root/bin/stack" init -o "$smoke_directory/diagram.stack"
"$native_root/bin/stack" check "$smoke_directory/diagram.stack"
"$native_root/bin/stack" render "$smoke_directory/diagram.stack" -o "$smoke_directory/diagram.svg"
test -s "$smoke_directory/diagram.svg"
- name: Validate release supply chain
run: |
node --check scripts/create-supply-chain-smoke-fixture.mjs
node --check scripts/release-security.mjs
node --check scripts/resolve-release-context.mjs
node --check scripts/validate-release-workflow.mjs
node scripts/validate-supply-chain-workflow.mjs
node scripts/validate-release-workflow.mjs
node --test scripts/release-security.test.mjs scripts/supply-chain-workflow.test.mjs scripts/resolve-release-context.test.mjs scripts/release-workflow.test.mjs
python3 -m unittest scripts/test_normalize_macos_binary.py scripts/test_package_release.py
- name: Validate pinned example templates
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: node scripts/sync-example-templates.mjs --check
- name: Install latest stable Rust toolchain
run: rustup toolchain install stable --profile minimal --component clippy,rustfmt,llvm-tools-preview
- name: Check formatting
run: cargo +stable fmt --check
- name: Run tests
run: cargo +stable test --locked
- name: Run canonical formatter suite
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable test --features conformance --test formatter-conformance --locked
- name: Run template conformance suite
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable test --features conformance --test template-conformance --locked
- name: Run Clippy
run: cargo +stable clippy --all-targets --all-features --locked -- -D warnings
- name: Build documentation
env:
RUSTDOCFLAGS: -D warnings
run: cargo +stable doc --no-deps --locked
- name: Install cargo-llvm-cov
uses: taiki-e/install-action@e67fa11c4b9316fa714ddf0abed07a0c3143b95b # v2.87.4
with:
tool: cargo-llvm-cov@0.9.0
fallback: none
- name: Enforce test coverage
env:
STACK_SPECIFICATION_DIR: ${{ github.workspace }}/.stack-specification
run: cargo +stable llvm-cov --all-features --locked --fail-under-lines 90 --fail-under-functions 95 --fail-under-regions 90
- name: Build release binary
run: cargo +stable build --release --locked
- name: Validate rendered SVG
run: python3 scripts/validate-render.py
- name: Smoke test command metadata
run: |
./target/release/stack help
./target/release/stack help render
./target/release/stack help icons list
./target/release/stack version
./target/release/stack -h
./target/release/stack -v
./target/release/stack -V
./target/release/stack --help
./target/release/stack --version
./target/release/stack init --help
./target/release/stack check --help
./target/release/stack fmt --help
./target/release/stack render --help
./target/release/stack lsp --help
./target/release/stack icons --help
./target/release/stack icons list
./target/release/stack icons list aws s3
./target/release/stack icons import --help
- name: Verify repository files
run: |
test -s README.md
test -s AGENTS.md
test -s LICENSE
test -s NOTICE
test -s THIRD_PARTY_LICENSES.md
test -s CONTRIBUTING.md
test -s SECURITY.md
test -s docs/language-server.md
test -s docs/publication-audit.md
test -s docs/provider-icon-import.md
test -s docs/distribution.md
test -s docs/supply-chain.md
test -s aqua/README.md
test -s aqua/registry.yaml
test -s distribution/distribution-contract.json
test -s distribution/distribution-contract.schema.json
test -s distribution/release-manifest.schema.json
test -s Cargo.toml
test -s Cargo.lock
test -s src/config.rs
test -s src/lsp.rs
test -s src/main.rs
test -s src/templates.rs
test -s src/provider.rs
test -s src/provider_catalog.rs
test -s catalogs/aws.json
test -s catalogs/gcp.json
test -s catalogs/azure.json
test -s catalogs/simple-icons.json
test -s scripts/generate-provider-catalogs.mjs
test -s scripts/aqua-registry.test.mjs
test -s scripts/sync-example-templates.mjs
test -s scripts/validate-provider-catalogs.mjs
test -s scripts/validate-distribution-contract.mjs
test -s scripts/distribution-contract.test.mjs
test -s scripts/create-supply-chain-smoke-fixture.mjs
test -s scripts/release-security.mjs
test -s scripts/release-security.test.mjs
test -s scripts/package_release.py
test -s scripts/normalize_macos_binary.py
test -s scripts/test_normalize_macos_binary.py
test -s scripts/test_package_release.py
test -s scripts/verify_release_binary.py
test -s scripts/resolve-release-context.mjs
test -s scripts/resolve-release-context.test.mjs
test -s scripts/validate-release-workflow.mjs
test -s scripts/release-workflow.test.mjs
test -s scripts/validate-supply-chain-workflow.mjs
test -s scripts/supply-chain-workflow.test.mjs
test -s tests/aqua/aqua.yaml
test -s tests/aqua/aqua-checksums.json
test -s tests/aqua/aqua-policy.yaml
test -s .github/workflows/release.yaml
test -s .github/workflows/supply-chain.yaml
test -s templates/catalog.json
test -s templates/sources/01-minimal.stack
test -s tests/specification-revision
test -s tests/fixtures/render.stack
test -s tests/snapshots/lsp-help.txt
msrv:
name: Minimum supported Rust
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v7
- name: Install Rust 1.85
run: rustup toolchain install 1.85.0 --profile minimal --component clippy
- name: Run tests
run: cargo +1.85.0 test --locked
- name: Run Clippy
run: cargo +1.85.0 clippy --all-targets --all-features --locked -- -D warnings