forked from git-ai-project/git-ai
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (58 loc) · 1.97 KB
/
github-integration-tests.yml
File metadata and controls
66 lines (58 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
name: Integration Tests - GitHub
on:
workflow_dispatch:
inputs:
no-cleanup:
description: 'Skip cleanup (leave test repos for inspection)'
required: false
type: boolean
default: false
jobs:
github-integration:
name: GitHub Integration Tests
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Cache dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry
~/.cargo/git
target
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Authenticate GitHub CLI
env:
GH_INTEGRATION_TEST_TOKEN: ${{ secrets.GH_INTEGRATION_TEST_TOKEN }}
run: |
if [ -z "$GH_INTEGRATION_TEST_TOKEN" ]; then
echo "❌ GH_INTEGRATION_TEST_TOKEN secret is not set"
echo "Please add a Personal Access Token with 'repo', 'delete_repo', and 'read:org' scopes"
exit 1
fi
echo "$GH_INTEGRATION_TEST_TOKEN" | gh auth login --with-token
gh auth status
- name: Configure git credentials
env:
GH_INTEGRATION_TEST_TOKEN: ${{ secrets.GH_INTEGRATION_TEST_TOKEN }}
run: |
git config --global credential.helper store
echo "https://x-access-token:${GH_INTEGRATION_TEST_TOKEN}@github.com" > ~/.git-credentials
- name: Run GitHub integration tests
run: |
if [ "${{ inputs.no-cleanup }}" = "true" ]; then
export GIT_AI_TEST_NO_CLEANUP=1
fi
cargo test --test github_integration -- --ignored --nocapture
env:
GH_INTEGRATION_TEST_TOKEN: ${{ secrets.GH_INTEGRATION_TEST_TOKEN }}