Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
kiyoon committed Jul 2, 2024
1 parent d5481ef commit d4506e4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 38 deletions.
46 changes: 8 additions & 38 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,28 @@ on:
- push
- pull_request

jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/skip-duplicate-actions@v5
with:
# All of these options are optional, so you can remove them if you are happy with the defaults
concurrent_skipping: 'same_content_newer'
skip_after_successful_duplicate: 'true'
paths_ignore: '["**/README.md", "**/docs/**"]'
# do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: true

jobs:
pytest:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0} # setup-miniconda requires bash
steps:
- uses: actions/checkout@v4
- run: |
echo "python_version=$(python3 scripts/get_python_version.py)" >> "$GITHUB_OUTPUT"
pip3 install --user uv maturin
id: get-python-version
- uses: actions/setup-python@v5
with:
python-version: ${{ steps.get-python-version.outputs.python_version }}
- uses: deargen/workflows/actions/setup-python-and-uv@master
- name: Install dependencies
run: |
uv venv
source .venv/bin/activate
uv pip install -r deps/x86_64-unknown-linux-gnu/requirements_dev.txt
uv pip install -r deps/lock/x86_64-unknown-linux-gnu/requirements_dev.txt
bash scripts/install.sh
python3 scripts/hf_download.py
- name: Run pytest
uses: deargen/workflows/actions/run-pytest@master

cargo-test:
needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true'
runs-on: ubuntu-latest
defaults:
run:
shell: bash -el {0} # setup-miniconda requires bash
steps:
- uses: actions/checkout@v4
- name: Run cargo test
Expand All @@ -69,9 +41,7 @@ jobs:
echo "${err}"
# Display the Markdown output in the job summary
echo "\`\`\`python" >> $GITHUB_STEP_SUMMARY
echo "${out}" >> $GITHUB_STEP_SUMMARY
echo "${err}" >> $GITHUB_STEP_SUMMARY
echo "\`\`\`" >> $GITHUB_STEP_SUMMARY
{ echo "\`\`\`python"; echo "${out}"; echo "${err}"; echo "\`\`\`"; } >> "$GITHUB_STEP_SUMMARY"
# Exit with the exit-code returned by test
exit ${exit_code}
1 change: 1 addition & 0 deletions deps/requirements_dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ ruff==0.5.0
pytest
huggingface_hub
toml
maturin

# test requirements
rich
Expand Down

0 comments on commit d4506e4

Please sign in to comment.