From fc5fbdf6fa29682f26f8d32c477b4dac8c810589 Mon Sep 17 00:00:00 2001 From: Joe Vilches Date: Fri, 8 Dec 2023 17:28:52 -0800 Subject: [PATCH] GitHub workflow to ensure tests are up to date (#1505) Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1505 This will ensure that all tests are not modified by hand and that gentest was run if needed (i.e. someone edited those files and forgot to update the tests). Not sure if this works right now, need to export to github and see what happens :) Differential Revision: D52002920 fbshipit-source-id: cc8f6ad0f8482f2628da1619a0de54c4b8963587 --- .github/workflows/validate-tests.yml | 32 ++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 .github/workflows/validate-tests.yml diff --git a/.github/workflows/validate-tests.yml b/.github/workflows/validate-tests.yml new file mode 100644 index 0000000000..d56b6e82e3 --- /dev/null +++ b/.github/workflows/validate-tests.yml @@ -0,0 +1,32 @@ +name: Validate Tests + +on: + pull_request: + push: + branches: + - main + - 'release-*' + workflow_dispatch: + +jobs: + validate: + name: Validate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup-js + + - name: yarn gentest-validate + run: yarn gentest-validate + + - name: yarn gentest + run: yarn gentest + + - name: Check for modified tests + run: | + if [[ -n $(git status -s) ]]; then + echo "yarn gentest modifed tests. Please run yarn gentest to resolve." + exit 1 + fi