Skip to content

Commit

Permalink
Set up action to validate TOML files
Browse files Browse the repository at this point in the history
  • Loading branch information
homeworkprod committed Feb 3, 2024
1 parent 3d0561f commit cbebfc5
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Validate data files

on:
push:
paths:
- 'data/**/*.toml'

pull_request:
paths:
- 'data/**/*.toml'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Setup cache for Taplo CLI executable
id: cache-taplo
uses: actions/cache@v4
with:
path: /usr/local/bin/taplo
key: taplo-0.8.1

- name: Install Taplo CLI
if: steps.cache-taplo.outputs.cache-hit != 'true'
run: |
wget -q -O - 'https://github.com/tamasfe/taplo/releases/download/0.8.1/taplo-linux-x86_64.gz' | gunzip -c > /usr/local/bin/taplo
chmod u+x /usr/local/bin/taplo
- name: Validate party series TOML file
run: taplo check data/series.toml && taplo format --check data/series.toml

- name: Validate party TOML files
run: |
shopt -s globstar
taplo check data/parties/**/*.toml && taplo format --check data/parties/**/*.toml

0 comments on commit cbebfc5

Please sign in to comment.