From a571bebd2f6d7ccd8aba8d2f00ed1567454565ba Mon Sep 17 00:00:00 2001 From: Leo Cavalcante Date: Tue, 29 Sep 2026 15:21:40 -0300 Subject: [PATCH] chore(ci): Check feature manifests and shell scripts --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..6dfa9c8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,53 @@ +name: CI +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + +jobs: + checks: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Validate feature manifests + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + manifests=(features/*/devcontainer-feature.json) + if [[ ${#manifests[@]} -eq 0 ]]; then + echo "No devcontainer-feature.json files found." + exit 1 + fi + for manifest in "${manifests[@]}"; do + jq -e '.id and .version and .name' "${manifest}" >/dev/null + echo "ok ${manifest}" + done + - name: Shellcheck feature scripts + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + scripts=(features/*/install.sh) + if [[ ${#scripts[@]} -eq 0 ]]; then + echo "No feature install scripts found." + exit 1 + fi + shellcheck -x "${scripts[@]}" + - name: Run shell tests + shell: bash + run: | + set -euo pipefail + shopt -s nullglob + tests=(tests/*.sh) + if [[ ${#tests[@]} -eq 0 ]]; then + echo "No shell tests in tests/." + exit 0 + fi + for test in "${tests[@]}"; do + bash "${test}" + done