Skip to content

Commit

Permalink
chore(testdata): Add workflow to ensure testdata is sorted (#410)
Browse files Browse the repository at this point in the history
* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* Update test.yml

* update command

* move error mocks

* update test cases

* fix command

* update command

* fix command

* fix command

* fix command

* fix ocmmand

* fix command

* fix command

* fix command

* fix command

* fix command

* fix command

* order test data

* sort keys

* sort keys

* move to dedicated workflow
  • Loading branch information
CFenner authored Oct 1, 2024
1 parent 7c3a449 commit 972ea75
Show file tree
Hide file tree
Showing 40 changed files with 55,085 additions and 51,296 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Format

# yamllint disable-line rule:truthy
on:
push:
branches:
- main
- master
pull_request:
workflow_dispatch:

env:
DEFAULT_PYTHON: "3.11"

jobs:
sort:
name: sort testdata
runs-on: ubuntu-latest
steps:
- name: ⤵️ Check out code from GitHub
uses: actions/[email protected]
- name: 🚀 Sort test response data
run: |
find './tests/response' \
-maxdepth '1' \
-type 'f' \
-name '*.json' \
-exec sh -c 'mv $1 $1.tmp; jq ".data|=sort_by(.feature)" --sort-keys $1.tmp > $1; rm $1.tmp' shell {} ";"
- name: 🔍 Verify
run: git diff --name-only --exit-code
Loading

0 comments on commit 972ea75

Please sign in to comment.