Repository navigation
100 lines (87 loc) · 2.72 KB
/
Copy pathtest_example.yml
File metadata and controls
100 lines (87 loc) · 2.72 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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Test In Example
on:
push:
branches:
- master
pull_request:
permissions:
contents: read
jobs:
unit:
strategy:
matrix:
go: [ "1.26", "1.27" ]
runs-on: ubuntu-latest
steps:
- name: Checkout framework
uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
path: framework
- name: Checkout goravel/example
uses: actions/checkout@v7
with:
repository: goravel/example
ref: master
path: example
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
- name: Go mod cache
uses: actions/cache@v6
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('example/**/go.sum', 'framework/**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go }}-
- name: Replace framework with local checkout
working-directory: example
run: |
go mod edit -replace github.com/goravel/framework=../framework
go mod tidy
- name: Run tests
working-directory: example
run: go test -timeout 10m -run "^TestMainTestSuite$" . ./app/...
integration:
strategy:
matrix:
go: [ "1.26", "1.27" ]
runs-on: ubuntu-latest
steps:
- name: Checkout framework
uses: actions/checkout@v7
with:
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
ref: ${{ github.event.pull_request.head.sha || github.sha }}
path: framework
- name: Checkout goravel/example
uses: actions/checkout@v7
with:
repository: goravel/example
ref: master
path: example
- name: Set up Go ${{ matrix.go }}
uses: actions/setup-go@v7
with:
go-version: ${{ matrix.go }}
- name: Go mod cache
uses: actions/cache@v6
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ matrix.go }}-${{ hashFiles('example/**/go.sum', 'framework/**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-${{ matrix.go }}-
- name: Replace framework with local checkout
working-directory: example
run: |
go mod edit -replace github.com/goravel/framework=../framework
go mod tidy
- name: Run tests
working-directory: example
run: go test -timeout 10m ./tests/...