Fix unwrap() in test for repo opening #38
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Rust | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
env: | |
CARGO_TERM_COLOR: always | |
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }} | |
MAX_LENGTH: 100 | |
MAX_CHARS: 5000 | |
LANGUAGE: "en" | |
TIMEOUT: 30 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Update system packages | |
run: sudo apt-get update | |
- name: Install latest Git | |
run: sudo apt-get install -y git | |
- name: Cache cargo registry | |
uses: actions/cache@v2 | |
with: | |
path: | | |
~/.cargo/registry | |
~/.cargo/git | |
target | |
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: nightly | |
override: true | |
default: true | |
profile: minimal | |
- name: Build git-ai-hook | |
uses: actions-rs/cargo@v1 | |
with: | |
command: build | |
args: --release --bin git-ai-hook --no-default-features | |
- name: Install git-ai | |
uses: actions-rs/cargo@v1 | |
with: | |
command: install | |
args: --path . --bin git-ai --no-default-features | |
- name: Run tests | |
uses: actions-rs/cargo@v1 | |
with: | |
command: test | |
# - name: Test install hook | |
# run: git ai install | |
# - name: Run Clippy | |
# uses: actions-rs/clippy-check@v1 | |
# with: | |
# token: ${{ secrets.GITHUB_TOKEN }} |