mirror of
https://github.com/tiennm99/composes.git
synced 2026-10-11 03:13:16 +00:00
ci: add mit license + validate workflow
workflow runs on push to main and all prs: - docker compose config -q (yaml + env interpolation) - yq extract embedded alloy config - alloy fmt (syntax check)
This commit is contained in:
1 parent
ca22737dfb
commit
2ff943190c
2 files changed
+54
No files matched your search
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
name: validate
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
runs-on: ubuntu-latest
|
||||
env:
|
||||
# Dummy values so `compose config` doesn't fail on the `:?required` guards.
|
||||
ALLOY_HOSTNAME: ci
|
||||
PROM_URL: https://example.com
|
||||
PROM_USER: "1"
|
||||
LOKI_URL: https://example.com
|
||||
LOKI_USER: "1"
|
||||
GRAFANA_TOKEN: x
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Validate compose YAML + env interpolation
|
||||
run: docker compose config -q
|
||||
|
||||
- name: Extract embedded Alloy config
|
||||
uses: mikefarah/yq@v4
|
||||
with:
|
||||
cmd: yq '.configs.alloy_config.content' docker-compose.yml > config.alloy
|
||||
|
||||
- name: Validate Alloy config syntax
|
||||
run: |
|
||||
docker run --rm -v "$PWD/config.alloy:/config.alloy:ro" \
|
||||
grafana/alloy:v1.10.0 fmt /config.alloy > /dev/null
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2026 tiennm99
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
Reference in new issue
Block a user