Skip to content

Commit 48d1401

Browse files
authored
Merge pull request #182 from darsnack/retest-gha
2 parents b37bee7 + 07e7655 commit 48d1401

File tree

5 files changed

+62
-16
lines changed

5 files changed

+62
-16
lines changed

.github/workflows/CI.yml

Lines changed: 48 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111

1212
jobs:
1313
test:
14-
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
14+
name: ${{ matrix.suite }} - Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
1515
runs-on: ${{ matrix.os }}
1616
strategy:
1717
fail-fast: false
@@ -21,10 +21,22 @@ jobs:
2121
- 'nightly'
2222
os:
2323
- ubuntu-latest
24-
- macOS-latest
24+
# - macOS-latest
2525
# - windows-latest
2626
arch:
2727
- x64
28+
suite:
29+
- '["AlexNet", "VGG"]'
30+
- '["GoogLeNet", "SqueezeNet"]'
31+
- '["EfficientNet", "MobileNet"]'
32+
- '[r"/*/ResNet*", "ResNeXt"]'
33+
- 'r"/*/Inception/Inceptionv*"'
34+
- '["InceptionResNetv2", "Xception"]'
35+
- '"DenseNet"'
36+
- '"ConvNeXt"'
37+
- '"ConvMixer"'
38+
- '"ViT"'
39+
- '"Other"'
2840
steps:
2941
- uses: actions/checkout@v2
3042
- uses: julia-actions/setup-julia@v1
@@ -42,12 +54,42 @@ jobs:
4254
${{ runner.os }}-test-
4355
${{ runner.os }}-
4456
- uses: julia-actions/julia-buildpkg@v1
45-
- uses: julia-actions/julia-runtest@v1
57+
- name: "Setup environment"
58+
run: |
59+
julia --project=./test -e 'using Pkg; Pkg.develop(path = ".")'
60+
- name: "Run tests + coverage"
61+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
62+
run: |
63+
julia --code-coverage=user --color=yes --depwarn=yes --project=./test -e 'include("test/retest.jl"); retest(${{ matrix.suite }})'
64+
shell: bash
65+
- name: "Run tests only"
66+
if: ${{ !(matrix.version == '1' && matrix.os == 'ubuntu-latest') }}
67+
run: |
68+
julia --color=yes --depwarn=yes --project=./test -e 'include("test/retest.jl"); retest(${{ matrix.suite }})'
69+
continue-on-error: ${{ matrix.version == 'nightly' }}
70+
shell: bash
71+
- uses: actions/upload-artifact@v3
4672
with:
47-
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
48-
- uses: julia-actions/julia-processcoverage@v1
73+
name: coverage-${{ hashFiles('**/*.cov') }}
74+
path: '**/*.cov'
4975
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
76+
77+
coverage:
78+
name: "Coverage"
79+
runs-on: ubuntu-latest
80+
needs: test
81+
steps:
82+
- uses: actions/checkout@v2
83+
- uses: julia-actions/setup-julia@v1
84+
with:
85+
version: '1'
86+
arch: x64
87+
- uses: julia-actions/julia-buildpkg@v1
88+
- uses: actions/download-artifact@v3
89+
- run: |
90+
cp -r coverage-*/* .
91+
rm -rf coverage-*
92+
- uses: julia-actions/julia-processcoverage@v1
5093
- uses: codecov/codecov-action@v2
51-
if: matrix.version == '1' && matrix.os == 'ubuntu-latest'
5294
with:
5395
file: lcov.info

Project.toml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,7 @@ MLUtils = "0.2.6"
2121
NNlib = "0.7.34, 0.8"
2222
julia = "1.6"
2323

24-
[extras]
25-
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
26-
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
27-
2824
[publish]
2925
ignore = ["^(gh-pages|juliamnt|julia.dmg)$"]
3026
theme = "_flux-theme"
3127
title = "Metalhead.jl"
32-
33-
[targets]
34-
test = ["Images", "Test"]

test/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[deps]
2+
Flux = "587475ba-b771-5e3f-ad9e-33799f191a9c"
3+
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0"
4+
ReTest = "e0db7c4e-2690-44b9-bad6-7687da720f89"
5+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

test/convnets.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ GC.gc()
125125
if Inceptionv4 in PRETRAINED_MODELS
126126
@test acctest(Inceptionv4(pretrain = true))
127127
else
128-
@test_throws ArgumentError InceptionResNetv2(pretrain = true)
128+
@test_throws ArgumentError Inceptionv4(pretrain = true)
129129
end
130130
@test gradtest(m, x_299)
131131
end
@@ -236,7 +236,7 @@ GC.safepoint()
236236
GC.gc()
237237

238238
@testset "ConvNeXt" verbose = true begin
239-
@testset for mode in [:small, :base] #, :large # :tiny, #, :xlarge]
239+
@testset for mode in [:small, :base, :large, :tiny, :xlarge]
240240
@testset for drop_path_rate in [0.0, 0.5]
241241
m = ConvNeXt(mode; drop_path_rate)
242242
@test size(m(x_224)) == (1000, 1)
@@ -251,7 +251,7 @@ GC.safepoint()
251251
GC.gc()
252252

253253
@testset "ConvMixer" verbose = true begin
254-
@testset for mode in [:small, :base] #, :large]
254+
@testset for mode in [:small, :base, :large]
255255
m = ConvMixer(mode)
256256

257257
@test size(m(x_224)) == (1000, 1)

test/retest.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# To run this file locally,
2+
# use TestEnv.jl to activate the testing environment
3+
# Then include this file
4+
5+
using ReTest, Metalhead
6+
ReTest.hijack(Metalhead; include = :static)

0 commit comments

Comments
 (0)