Skip to content

Commit

Permalink
Add workflow for linting mixins individually
Browse files Browse the repository at this point in the history
  • Loading branch information
Dasomeone committed Oct 22, 2024
1 parent c09b64b commit 72e5225
Showing 1 changed file with 44 additions and 5 deletions.
49 changes: 44 additions & 5 deletions .github/workflows/lint-mixins.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: "Lint Mixins"
name: Mixin

permissions:
contents: read
Expand All @@ -8,11 +8,11 @@ on:
# To conserve resources we only run tests against main in PRs
pull_request:
branches:
- main
- master

jobs:
check-for-changed-mixins:
name: Check for changed mixins
name: Check for changes
runs-on: ubuntu-latest
outputs:
changed-mixins: ${{ steps.changed-mixins.outputs.all_changed_files }}
Expand All @@ -37,8 +37,47 @@ jobs:
dir_names: true
dir_names_exclude_current_dir: true
dir_names_max_depth: 1
files: **-mixin/
files: |
**-mixin/
matrix: true

- name: List all changed mixins:
- name: List all changed mixins
run: echo '${{ steps.changed-mixins.outputs.all_changed_files }}'

lint-mixin:
name: Run Mixtool
runs-on: ubuntu-latest
permissions:
issues: write
contents: write
pull-requests: write
repository-projects: write
timeout-minutes: 15
needs: [check-for-changed-mixins]
strategy:
matrix:
mixin: ${{ fromJSON(needs.check-for-changed-mixins.outputs.changed-mixins) }}
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: 1.18

- name: Install CI dependencies
run: make install-ci-deps

- name: Install Mixin dependencies
working-directory: ./${{ matrix.mixin }}
run: jb install

- name: Lint Mixin
working-directory: ./${{ matrix.mixin }}
run: mixtool lint mixin.libsonnet


0 comments on commit 72e5225

Please sign in to comment.