Skip to content

Merge pull request #1 from ademyanchuk/dependabot/cargo/rustix-0.38.21 #22

Merge pull request #1 from ademyanchuk/dependabot/cargo/rustix-0.38.21

Merge pull request #1 from ademyanchuk/dependabot/cargo/rustix-0.38.21 #22

Workflow file for this run

# from https://github.com/jonhoo/rust-ci-conf/blob/main/.github/workflows/test.yml
# TODO: think about minimal versions (make dependencies more permissive)
permissions:
contents: read
on:
push:
branches: [master]
pull_request:
# Spend CI time only on latest ref: https://github.com/jonhoo/rust-ci-conf/pull/5
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
name: test
jobs:
setup:
runs-on: ubuntu-latest
outputs:
cache-hit: ${{ steps.cache.outputs.cache-hit }}
steps:
- name: Checkout code
uses: actions/checkout@v4
# Attempt to restore from cache
- name: Cache model
id: cache
uses: actions/cache@v3
with:
path: ./stories15M_BlockQ8.bin
key: model-static-key
# Download model only if not present in cache
- name: Download model from Hugging Face
if: steps.cache.outputs.cache-hit != 'true'
run: curl -Lo stories15M_BlockQ8.bin https://huggingface.co/ademyanchuk/tinyllama-quantized/resolve/main/stories15M_BlockQ8.bin
# Upload artifact
- name: Upload model as artifact
uses: actions/upload-artifact@v2
with:
name: stories15M_BlockQ8.bin
path: ./stories15M_BlockQ8.bin
required:
runs-on: ubuntu-latest
name: ubuntu / stable
needs: setup
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Download model artifact
uses: actions/download-artifact@v2
with:
name: stories15M_BlockQ8.bin
path: ./
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo test --locked
run: |
cargo test --locked --all-features --tests
cargo test --locked --all-features --lib
cargo test --locked --all-features --examples
- name: cargo test --doc
run: cargo test --locked --all-features --doc
os-check:
runs-on: ${{ matrix.os }}
name: ${{ matrix.os }} / stable
needs: setup
strategy:
fail-fast: false
matrix:
os: [macos-latest, windows-latest]
steps:
# if your project needs OpenSSL, uncomment this to fix Windows builds.
# it's commented out by default as tthe install command takes 5-10m.
# - run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
# if: runner.os == 'Windows'
# - run: vcpkg install openssl:x64-windows-static-md
# if: runner.os == 'Windows'
- uses: actions/checkout@v4
with:
submodules: true
- name: Download model artifact
uses: actions/download-artifact@v2
with:
name: stories15M_BlockQ8.bin
path: ./
- name: Install stable
uses: dtolnay/rust-toolchain@stable
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo test
run: |
cargo test --locked --all-features --tests
cargo test --locked --all-features --lib
cargo test --locked --all-features --examples
coverage:
runs-on: ubuntu-latest
name: ubuntu / stable / coverage
needs: setup
env:
EXE_PATH: target/llvm-cov-target/debug/llama2-rs
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Download model artifact
uses: actions/download-artifact@v2
with:
name: stories15M_BlockQ8.bin
path: ./
- name: Install stable
uses: dtolnay/rust-toolchain@stable
with:
components: llvm-tools-preview
- name: cargo install cargo-llvm-cov
uses: taiki-e/install-action@cargo-llvm-cov
- name: cargo generate-lockfile
if: hashFiles('Cargo.lock') == ''
run: cargo generate-lockfile
- name: cargo llvm-cov
run: cargo llvm-cov --locked --all-features --lcov --output-path lcov.info
- name: Upload to codecov.io
uses: codecov/codecov-action@v3
with:
fail_ci_if_error: true