Skip to content

Commit

Permalink
add smoketest
Browse files Browse the repository at this point in the history
  • Loading branch information
dakinggg committed Dec 15, 2023
1 parent 5cc4dd4 commit cc60d01
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/smoketest.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Smoketest
on:
push:
branches:
- main
- release/*
pull_request:
branches:
- main
- release/*
workflow_dispatch:
# Cancel old runs when a new commit is pushed to the same branch if not on main or dev
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}
defaults:
run:
working-directory: .
jobs:
smoketest:
runs-on: ubuntu-20.04
timeout-minutes: 10
strategy:
matrix:
python_version:
- "3.9"

Check failure on line 26 in .github/workflows/smoketest.yaml

View workflow job for this annotation

GitHub Actions / code-quality (3.9, [dev])

26:11 [indentation] wrong indentation: expected 8 but found 10

Check failure on line 26 in .github/workflows/smoketest.yaml

View workflow job for this annotation

GitHub Actions / code-quality (3.10, [dev])

26:11 [indentation] wrong indentation: expected 8 but found 10
- "3.10"
steps:
- uses: actions/checkout@v3

Check failure on line 29 in .github/workflows/smoketest.yaml

View workflow job for this annotation

GitHub Actions / code-quality (3.9, [dev])

29:7 [indentation] wrong indentation: expected 4 but found 6

Check failure on line 29 in .github/workflows/smoketest.yaml

View workflow job for this annotation

GitHub Actions / code-quality (3.10, [dev])

29:7 [indentation] wrong indentation: expected 4 but found 6
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python_version }}
- name: Setup
run: |
set -ex
python -m pip install --upgrade 'pip<23' wheel
python -m pip install --upgrade .
python -m pip install pytest==7.2.1 pytest_codeblocks==0.16.1
- name: Run checks
run: |
pytest tests/test_smoketest.py
16 changes: 16 additions & 0 deletions tests/test_smoketest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Copyright 2022 MosaicML LLM Foundry authors
# SPDX-License-Identifier: Apache-2.0

from llmfoundry import (callbacks, data, models, optim, tokenizers, utils)


# This very simple test is just to use the above imports, which check and make sure we can import all the top-level
# modules from foundry. This is mainly useful for checking that we have correctly conditionally imported all optional
# dependencies.
def test_smoketest():
assert callbacks
assert data
assert models
assert optim
assert tokenizers
assert utils

0 comments on commit cc60d01

Please sign in to comment.