-
Notifications
You must be signed in to change notification settings - Fork 1
86 lines (72 loc) · 2.11 KB
/
test.yml
File metadata and controls
86 lines (72 loc) · 2.11 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Test Action
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
jobs:
test-basic:
name: Test basic installation
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Test action
uses: ./
with:
version: 'latest'
- name: Verify installation
shell: bash
run: |
dbc --version
command -v dbc || where dbc
test-with-version:
name: Test with specific version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Test action with version
uses: ./
with:
version: 'v0.2.0'
- name: Verify version
run: |
VERSION=$(dbc --version)
echo "Installed version: $VERSION"
echo "$VERSION" | grep -q "v0.2.0" || (echo "Expected v0.2.0 but got $VERSION" && exit 1)
test-with-drivers:
name: Test driver installation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Test with drivers
uses: ./
with:
drivers: 'sqlite'
test-cache:
name: Test caching
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: First run
id: first
uses: ./
- name: Remove dbc and cached files
run: |
DBC_PATH=$(command -v dbc)
if [ -n "$DBC_PATH" ]; then
rm -f "$DBC_PATH"
fi
# Remove Linux-specific cached paths to test cache restoration
rm -rf ~/.local/bin/dbc ~/.local/share/dbc ~/.config/dbc
- name: Second run (should restore from cache)
id: second
uses: ./
- name: Verify cache was used
run: |
if [ "${{ steps.second.outputs.cache-hit }}" != "true" ]; then
echo "Cache was not used!"
exit 1
fi