Skip to content

Commit 2493109

Browse files
authored
Update CI (#6)
* Update CompatHelper.yml * Update and rename ci.yml to CI.yml * Update badges * Create Format.yml * Update README.md * Create .JuliaFormatter.toml * Fix format
1 parent be678a3 commit 2493109

7 files changed

Lines changed: 120 additions & 65 deletions

File tree

.JuliaFormatter.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
style="blue"
Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,15 @@ name: CI
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88

9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
915
jobs:
1016
test:
1117
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
@@ -19,19 +25,18 @@ jobs:
1925
- 'nightly'
2026
os:
2127
- ubuntu-latest
22-
- macOS-latest
23-
- windows-latest
2428
arch:
25-
- x86
2629
- x64
2730
include:
2831
- version: '1'
2932
os: ubuntu-latest
30-
arch: x64
31-
coverage: true
32-
exclude:
33-
- os: macOS-latest
3433
arch: x86
34+
- version: '1'
35+
os: macOS-latest
36+
arch: x64
37+
- version: '1'
38+
os: windows-latest
39+
arch: x64
3540
steps:
3641
- uses: actions/checkout@v2
3742
- uses: julia-actions/setup-julia@v1
@@ -50,14 +55,16 @@ jobs:
5055
${{ runner.os }}-
5156
- uses: julia-actions/julia-buildpkg@v1
5257
- uses: julia-actions/julia-runtest@v1
58+
with:
59+
coverage: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64' }}
5360
- uses: julia-actions/julia-processcoverage@v1
54-
if: matrix.coverage
61+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
5562
- uses: codecov/codecov-action@v1
56-
if: matrix.coverage
63+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
5764
with:
5865
file: lcov.info
5966
- uses: coverallsapp/github-action@master
60-
if: matrix.coverage
67+
if: matrix.version == '1' && matrix.os == 'ubuntu-latest' && matrix.arch == 'x64'
6168
with:
6269
github-token: ${{ secrets.GITHUB_TOKEN }}
6370
path-to-lcov: lcov.info

.github/workflows/CompatHelper.yml

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,33 @@
11
name: CompatHelper
2+
23
on:
34
schedule:
4-
- cron: '00 00 * * *'
5+
- cron: 0 0 * * *
56
workflow_dispatch:
7+
68
jobs:
79
CompatHelper:
810
runs-on: ubuntu-latest
911
steps:
10-
- name: Pkg.add("CompatHelper")
11-
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
12-
- name: CompatHelper.main()
12+
- name: "Add the General registry via Git"
13+
run: |
14+
import Pkg
15+
ENV["JULIA_PKG_SERVER"] = ""
16+
Pkg.Registry.add("General")
17+
shell: julia --color=yes {0}
18+
- name: "Install CompatHelper"
19+
run: |
20+
import Pkg
21+
name = "CompatHelper"
22+
uuid = "aa819f21-2bde-4658-8897-bab36330d9b7"
23+
version = "3"
24+
Pkg.add(; name, uuid, version)
25+
shell: julia --color=yes {0}
26+
- name: "Run CompatHelper"
27+
run: |
28+
import CompatHelper
29+
CompatHelper.main()
30+
shell: julia --color=yes {0}
1331
env:
1432
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1533
COMPATHELPER_PRIV: ${{ secrets.COMPATHELPER_PRIV }}
16-
run: julia -e 'using CompatHelper; CompatHelper.main()'

.github/workflows/Format.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Format
2+
3+
on:
4+
pull_request:
5+
6+
concurrency:
7+
# Skip intermediate builds: always.
8+
# Cancel intermediate builds: only if it is a pull request build.
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
11+
12+
jobs:
13+
format:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: julia-actions/setup-julia@latest
18+
with:
19+
version: 1
20+
- name: Format code
21+
run: |
22+
using Pkg
23+
Pkg.add(; name="JuliaFormatter", uuid="98e50ef6-434e-11e9-1051-2b60c6c9e899")
24+
using JuliaFormatter
25+
format("."; verbose=true)
26+
shell: julia --color=yes {0}
27+
- uses: reviewdog/action-suggester@v1
28+
if: github.event_name == 'pull_request'
29+
with:
30+
tool_name: JuliaFormatter
31+
fail_on_error: true

README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# PalmerPenguins.jl <a href='https://allisonhorst.github.io/palmerpenguins'><img src='https://allisonhorst.github.io/palmerpenguins/reference/figures/logo.png' align="right" height="138.5" /></a>
22

3-
[![Build Status](https://github.com/devmotion/PalmerPenguins.jl/workflows/CI/badge.svg)](https://github.com/devmotion/PalmerPenguins.jl/actions?query=workflow%3ACI+branch%3Amaster)
4-
[![Coverage](https://codecov.io/gh/devmotion/PalmerPenguins.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/devmotion/PalmerPenguins.jl)
5-
[![Coverage](https://coveralls.io/repos/github/devmotion/PalmerPenguins.jl/badge.svg?branch=master)](https://coveralls.io/github/devmotion/PalmerPenguins.jl?branch=master)
3+
[![Build Status](https://github.com/devmotion/PalmerPenguins.jl/workflows/CI/badge.svg?branch=main)](https://github.com/devmotion/PalmerPenguins.jl/actions?query=workflow%3ACI+branch%3Amain)
4+
[![Coverage](https://codecov.io/gh/devmotion/PalmerPenguins.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/devmotion/PalmerPenguins.jl)
5+
[![Coverage](https://coveralls.io/repos/github/devmotion/PalmerPenguins.jl/badge.svg?branch=main)](https://coveralls.io/github/devmotion/PalmerPenguins.jl?branch=main)
6+
[![Code Style: Blue](https://img.shields.io/badge/code%20style-blue-4495d1.svg)](https://github.com/invenia/BlueStyle)
67

78
Load the [Palmer penguins dataset](https://allisonhorst.github.io/palmerpenguins/), an
89
alternative to the Iris dataset, in Julia.
@@ -59,7 +60,7 @@ julia> tableraw = PalmerPenguins.load(; raw = true)
5960
```
6061
If `raw = false` (the default), then the simplified version is returned.
6162

62-
## Bibliography
63+
## References
6364

6465
Gorman KB, Williams TD, Fraser WR (2014) Ecological Sexual Dimorphism and Environmental
6566
Variability within a Community of Antarctic Penguins (Genus Pygoscelis). PLoS ONE 9(3):

src/PalmerPenguins.jl

Lines changed: 38 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,39 @@
11
module PalmerPenguins
22

3-
import CSV
4-
import DataDeps
3+
using CSV: CSV
4+
using DataDeps: DataDeps
55

66
const DEPNAME = "PalmerPenguins"
77
const LINK = "https://cdn.jsdelivr.net/gh/allisonhorst/palmerpenguins@433439c8b013eff3d36c847bb7a27fa0d7e353d8/inst/extdata/"
88
const DATA = ["penguins.csv", "penguins_raw.csv"]
9-
const INFO =
10-
"""
11-
Dataset: The Palmer penguins dataset
12-
Authors: Allison Horst, Alison Hill, Kristen Gorman
13-
Website: https://allisonhorst.github.io/palmerpenguins/index.html
9+
const INFO = """
10+
Dataset: The Palmer penguins dataset
11+
Authors: Allison Horst, Alison Hill, Kristen Gorman
12+
Website: https://allisonhorst.github.io/palmerpenguins/index.html
1413
15-
The Palmer penguins dataset is a dataset for data exploration & visualization, as an
16-
alternative to the Iris dataset.
14+
The Palmer penguins dataset is a dataset for data exploration & visualization, as an
15+
alternative to the Iris dataset.
1716
18-
The dataset contains data for 344 penguins. There are 3 different species of penguins in
19-
this dataset, collected from 3 islands in the Palmer Archipelago, Antarctica.
17+
The dataset contains data for 344 penguins. There are 3 different species of penguins in
18+
this dataset, collected from 3 islands in the Palmer Archipelago, Antarctica.
2019
21-
Data were collected and made available by
22-
[Dr. Kristen Gorman](https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php)
23-
and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/), a member of the
24-
[Long Term Ecological Research Network](https://lternet.edu/).
20+
Data were collected and made available by
21+
[Dr. Kristen Gorman](https://www.uaf.edu/cfos/people/faculty/detail/kristen-gorman.php)
22+
and the [Palmer Station, Antarctica LTER](https://pal.lternet.edu/), a member of the
23+
[Long Term Ecological Research Network](https://lternet.edu/).
2524
26-
Data are available by
27-
[CC-0](https://creativecommons.org/share-your-work/public-domain/cc0/) license in
28-
accordance with the [Palmer Station LTER Data Policy](http://pal.lternet.edu/data/policies)
29-
and the
30-
[LTER Data Access Policy for Type I data](https://lternet.edu/data-access-policy/).
25+
Data are available by
26+
[CC-0](https://creativecommons.org/share-your-work/public-domain/cc0/) license in
27+
accordance with the [Palmer Station LTER Data Policy](http://pal.lternet.edu/data/policies)
28+
and the
29+
[LTER Data Access Policy for Type I data](https://lternet.edu/data-access-policy/).
3130
32-
Please include this citation if you plan to use this database:
33-
[Gorman et al., 2014]
34-
Gorman KB, Williams TD, Fraser WR (2014) Ecological Sexual Dimorphism and Environmental
35-
Variability within a Community of Antarctic Penguins (Genus Pygoscelis). PLoS ONE 9(3):
36-
e90081. https://doi.org/10.1371/journal.pone.0090081
37-
"""
31+
Please include this citation if you plan to use this database:
32+
[Gorman et al., 2014]
33+
Gorman KB, Williams TD, Fraser WR (2014) Ecological Sexual Dimorphism and Environmental
34+
Variability within a Community of Antarctic Penguins (Genus Pygoscelis). PLoS ONE 9(3):
35+
e90081. https://doi.org/10.1371/journal.pone.0090081
36+
"""
3837

3938
"""
4039
load([; raw = false])
@@ -51,21 +50,26 @@ the data is loaded.
5150
Variability within a Community of Antarctic Penguins (Genus Pygoscelis). PLoS ONE 9(3):
5251
e90081. https://doi.org/10.1371/journal.pone.0090081
5352
"""
54-
function load(; raw::Bool = false)
53+
function load(; raw::Bool=false)
5554
file = DataDeps.@datadep_str DEPNAME * "/" * DATA[1 + Int(raw)]
5655
return CSV.File(
5756
file;
58-
missingstring="NA", truestrings=["Yes"], falsestrings=["No"], dateformat="y-m-d",
57+
missingstring="NA",
58+
truestrings=["Yes"],
59+
falsestrings=["No"],
60+
dateformat="y-m-d",
5961
)
6062
end
6163

6264
function __init__()
63-
DataDeps.register(DataDeps.DataDep(
64-
DEPNAME,
65-
INFO,
66-
LINK .* DATA,
67-
"839b058be09b164f7dfa0d030a959cb3c5426dea281e8a34d34c557e398bd01f",
68-
))
65+
return DataDeps.register(
66+
DataDeps.DataDep(
67+
DEPNAME,
68+
INFO,
69+
LINK .* DATA,
70+
"839b058be09b164f7dfa0d030a959cb3c5426dea281e8a34d34c557e398bd01f",
71+
),
72+
)
6973
end
7074

7175
end

test/runtests.jl

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
3030
Union{Missing,String},
3131
]
3232
firstrow_simplified = [
33-
"Adelie",
34-
"Torgersen",
35-
39.1,
36-
18.7,
37-
Int64(181),
38-
Int64(3750),
39-
"male"
33+
"Adelie", "Torgersen", 39.1, 18.7, Int64(181), Int64(3750), "male"
4034
]
4135

4236
colnames_raw = [
@@ -99,7 +93,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
9993
@testset "load" begin
10094
@testset "simplified" begin
10195
table = PalmerPenguins.load()
102-
table2 = PalmerPenguins.load(; raw = false)
96+
table2 = PalmerPenguins.load(; raw=false)
10397
for i in 1:length(table)
10498
@test all(table[i] .=== table2[i])
10599
end
@@ -120,7 +114,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
120114
end
121115

122116
@testset "raw" begin
123-
table = PalmerPenguins.load(; raw = true)
117+
table = PalmerPenguins.load(; raw=true)
124118

125119
# Check some properties
126120
@test table isa CSV.File
@@ -141,7 +135,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
141135
@testset "DataFrames" begin
142136
@testset "simplified" begin
143137
df = DataFrame(PalmerPenguins.load())
144-
df2 = DataFrame(PalmerPenguins.load(; raw = false))
138+
df2 = DataFrame(PalmerPenguins.load(; raw=false))
145139
for i in 1:size(df, 2)
146140
@test all(df[!, i] .=== df2[!, i])
147141
end
@@ -162,7 +156,7 @@ ENV["DATADEPS_ALWAYS_ACCEPT"] = true
162156
end
163157

164158
@testset "raw" begin
165-
df = DataFrame(PalmerPenguins.load(; raw = true))
159+
df = DataFrame(PalmerPenguins.load(; raw=true))
166160

167161
# Check some properties
168162
@test df isa DataFrame

0 commit comments

Comments
 (0)