Skip to content

Commit

Permalink
CI: Test Dataset Tokenizer Selectively
Browse files Browse the repository at this point in the history
  • Loading branch information
Rexwang8 committed Oct 18, 2024
1 parent b3e3c63 commit 763b9ac
Showing 1 changed file with 27 additions and 1 deletion.
28 changes: 27 additions & 1 deletion .github/workflows/TestGPT_BPE.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ name: Test gpt_bpe_test.go

on:
push:
paths-ignore:
- "README.md"
- "LICENSE"
workflow_dispatch:

jobs:
Expand All @@ -19,7 +22,30 @@ jobs:
- name: Build
run: go build -v ./

- name: Test
- name: Check for changes to code
id: check_changes_repo
run: |
changed_files=$(git diff --name-only ${{ github.event.before }})
if echo "$changed_files" | grep -q '^cmd/dataset_tokenizer/'; then
echo "Dataset Tokenizer files have changed"
echo "run_dataset_tests=true" >> $GITHUB_ENV
fi
# Other changes
if echo "$changed_files" | grep -qv '^cmd/'; then
echo "Other files have changed"
echo "run_other_tests=true" >> $GITHUB_ENV
fi
- name: Test gpt_bpe
if: env.run_other_tests == 'true'
uses: robherley/go-test-action@v0
with:
testArguments: ./

- name: Test dataset_tokenizer
if: env.run_dataset_tests == 'true'
uses: robherley/go-test-action@v0
with:
testArguments: ./
moduleDirectory: ./cmd/dataset_tokenizer

0 comments on commit 763b9ac

Please sign in to comment.