Windows memory and service signals fix #201
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Mixin | |
permissions: | |
contents: read | |
on: | |
# To conserve resources we only run tests against main in PRs | |
pull_request: | |
branches: | |
- master | |
jobs: | |
setup: | |
name: Setup tools | |
runs-on: ubuntu-latest | |
outputs: | |
cache-hit: ${{ steps.tools-cache.outputs.cache-hit }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Tools cache | |
id: tools-cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/bin | |
/usr/local/bin/promtool | |
key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }} | |
- name: Install CI dependencies | |
if: steps.tools-cache.outputs.cache-hit != 'true' | |
run: make install-ci-deps | |
check-for-changed-mixins: | |
name: Check for changes | |
needs: setup | |
runs-on: ubuntu-latest | |
outputs: | |
changed-mixins: ${{ steps.changed-mixins.outputs.all_changed_files }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Get changed mixins | |
id: changed-mixins | |
uses: step-security/changed-files@3dbe17c78367e7d60f00d78ae6781a35be47b4a1 # v45.0.1 | |
with: | |
dir_names: true | |
dir_names_exclude_current_dir: true | |
dir_names_max_depth: 1 | |
files: | | |
**-mixin/ | |
**-observ-lib/ | |
matrix: true | |
- name: List all changed mixins | |
env: | |
ALL_CHANGED_FILES: ${{ steps.changed-mixins.outputs.all_changed_files }} | |
run: echo "${ALL_CHANGED_FILES}" | |
lint-mixin: | |
name: Test mixin | |
runs-on: ubuntu-latest | |
permissions: | |
issues: write | |
contents: write | |
pull-requests: write | |
repository-projects: write | |
timeout-minutes: 15 | |
needs: [setup, check-for-changed-mixins] | |
strategy: | |
matrix: | |
mixin: ${{ fromJSON(needs.check-for-changed-mixins.outputs.changed-mixins) }} | |
fail-fast: false | |
services: | |
grafana: | |
image: grafana/grafana:11.4.0 | |
ports: | |
- 3000:3000 | |
env: | |
GF_AUTH_DISABLE_LOGIN_FORM: "true" | |
GF_AUTH_ANONYMOUS_ENABLED: "true" | |
GF_AUTH_ANONYMOUS_ORG_ROLE: "Admin" | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
persist-credentials: false | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: 1.23 | |
- name: Restore Tools cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
~/go/bin | |
/usr/local/bin/promtool | |
key: ${{ runner.os }}-tools-${{ hashFiles('Makefile') }} | |
- name: Install mixin dependencies | |
working-directory: ./${{ matrix.mixin }} | |
run: make build | |
- name: Lint mixin | |
working-directory: ./${{ matrix.mixin }} | |
run: make lint | |
- name: Check for unexpected changes in generated files | |
working-directory: ./${{ matrix.mixin }} | |
run: "make -B dashboards_out prometheus_alerts.yaml prometheus_rules.yaml && git diff --exit-code || ( echo 'Error: Generated files are not up to date. Run make and commit the local diff'; exit 1; )" | |
- name: Wait for Grafana and validate dashboards | |
working-directory: ./${{ matrix.mixin }} | |
env: | |
GRAFANA_URL: http://localhost:3000 | |
run: | | |
# Wait for Grafana to be ready | |
timeout 60s bash -c 'until curl -s http://localhost:3000/api/health | grep "ok"; do sleep 1; done' | |
# Try to deploy dashboards | |
make deploy_dashboards | |
- name: Run promtool test for rules | |
working-directory: ./${{ matrix.mixin }} | |
run: make test |