diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 609cc92e..aeeb7e1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,6 +16,8 @@ jobs: uses: golangci/golangci-lint-action@v2 - name: Check license run: DOCKER_BUILDKIT=1 make check-license + - name: Check schema + run: make check-schema test: strategy: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml new file mode 100644 index 00000000..10ddff5d --- /dev/null +++ b/.github/workflows/sync.yml @@ -0,0 +1,29 @@ +name: Sync compose-spec + +on: + workflow_dispatch: + schedule: + - cron: "0 0 * * *" + +jobs: + schema: + name: Update Schema + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v3.3.0 + + - name: Download schema + run: curl -fSL -o schema/compose-spec.json https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json + + - name: Show diff + run: git diff schema/compose-spec.json + + - name: Create Pull Request + uses: peter-evans/create-pull-request@v4 + with: + title: Update compose-spec.json + commit-message: Update compose-spec.json + signoff: true + branch: compose-spec diff --git a/Makefile b/Makefile index e25e8f44..2cd26109 100644 --- a/Makefile +++ b/Makefile @@ -38,6 +38,11 @@ lint: build-validate-image check-license: build-validate-image docker run --rm $(IMAGE_PREFIX)validate bash -c "./scripts/validate/fileheader" +.PHONY: check-schema +check-schema: + curl -fSL -o schema/compose-spec.json https://raw.githubusercontent.com/compose-spec/compose-spec/master/schema/compose-spec.json + git diff --exit-code schema/compose-spec.json + .PHONY: setup setup: ## Setup the precommit hook @which pre-commit > /dev/null 2>&1 || (echo "pre-commit not installed see README." && false) diff --git a/schema/compose-spec.json b/schema/compose-spec.json index b7b90c3d..6f827971 100644 --- a/schema/compose-spec.json +++ b/schema/compose-spec.json @@ -141,6 +141,7 @@ }, "cap_add": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, "cap_drop": {"type": "array", "items": {"type": "string"}, "uniqueItems": true}, + "cgroup": {"type": "string", "enum": ["host", "private"]}, "cgroup_parent": {"type": "string"}, "command": { "oneOf": [ @@ -581,12 +582,12 @@ "items": { "type": "object", "properties": { - "capabilities": {"$ref": "#/definitions/list_of_strings"}, - "count": {"type": ["string", "integer"]}, - "device_ids": {"$ref": "#/definitions/list_of_strings"}, - "driver":{"type": "string"}, - "options":{"$ref": "#/definitions/list_or_dict"} - }, + "capabilities": {"$ref": "#/definitions/list_of_strings"}, + "count": {"type": ["string", "integer"]}, + "device_ids": {"$ref": "#/definitions/list_of_strings"}, + "driver":{"type": "string"}, + "options":{"$ref": "#/definitions/list_or_dict"} + }, "additionalProperties": false, "patternProperties": {"^x-": {}} }