-
Notifications
You must be signed in to change notification settings - Fork 24
129 lines (122 loc) · 4.26 KB
/
test.yml
File metadata and controls
129 lines (122 loc) · 4.26 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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
name: Run Tests
on:
push:
branches:
- master
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
version:
- '1'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-runtest@v1
with:
project: julia
coverage: true
- uses: julia-actions/julia-processcoverage@v1
with:
directories: julia/src
- uses: codecov/codecov-action@v4
with:
files: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: false
docker:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Build Docker image
run: docker build -t tagbot:test .
- name: Test Docker image loads
run: |
docker run --rm tagbot:test julia --color=yes --project=/app -e '
using TagBot
println("TagBot v", TagBot.VERSION, " loaded successfully")'
- name: Run tests in Docker
run: |
docker run --rm tagbot:test julia --color=yes --project=/app -e '
using Pkg
Pkg.test()'
- name: Run Docker integration test
env:
INPUT_TOKEN: ${{ github.token }}
run: |
# Clone Example.jl - a small, stable, registered package
git clone --depth=100 https://github.com/JuliaLang/Example.jl.git /tmp/Example.jl
# Run TagBot in the Docker container exactly as action.yml would
# (same CMD, same env vars GitHub Actions sets)
docker run --rm \
-v /tmp/Example.jl:/github/workspace:ro \
-e GITHUB_ACTIONS=true \
-e GITHUB_WORKSPACE=/github/workspace \
-e GITHUB_REPOSITORY=JuliaLang/Example.jl \
-e INPUT_TOKEN="${INPUT_TOKEN}" \
-e INPUT_REGISTRY=JuliaRegistries/General \
-e INPUT_SSH= \
-e INPUT_GPG= \
-e INPUT_DRAFT=false \
-e INPUT_BRANCHES=false \
-e INPUT_DISPATCH=false \
-e INPUT_DISPATCH_DELAY=5 \
-e INPUT_USER=github-actions[bot] \
-e INPUT_EMAIL=41898282+github-actions[bot]@users.noreply.github.com \
tagbot:test
# The container runs `julia -e "using TagBot; TagBot.main()"` by default
# For Example.jl (fully tagged), it should exit successfully with "No new versions"
integration:
name: Integration Test (Example.jl)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: '1'
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
with:
project: julia
- name: Clone test package (Example.jl)
run: git clone --depth=100 https://github.com/JuliaLang/Example.jl.git /tmp/Example.jl
- name: Run TagBot main() like action.yml does
env:
GITHUB_ACTIONS: true
GITHUB_WORKSPACE: /tmp/Example.jl
INPUT_TOKEN: ${{ github.token }}
INPUT_REGISTRY: JuliaRegistries/General
INPUT_SSH: ''
INPUT_GPG: ''
INPUT_DRAFT: 'false'
INPUT_BRANCHES: 'false'
INPUT_DISPATCH: 'false'
INPUT_DISPATCH_DELAY: '5'
INPUT_USER: github-actions[bot]
INPUT_EMAIL: 41898282+github-actions[bot]@users.noreply.github.com
run: |
cd julia
# Override GitHub's built-in GITHUB_REPOSITORY for testing
export GITHUB_REPOSITORY=JuliaLang/Example.jl
julia --color=yes --project=. -e '
using TagBot
println("="^60)
println("Integration Test - Running TagBot.main()")
println("="^60)
println("Repository: ", ENV["GITHUB_REPOSITORY"])
println("Registry: ", ENV["INPUT_REGISTRY"])
println()
# Run the actual main() function - same as Docker CMD
TagBot.main()
println()
println("="^60)
println("✅ TagBot.main() completed successfully")
println("="^60)
'