Skip to content

Commit ae685f4

Browse files
authored
Move CI to GitHub Actions (#27)
1 parent f3de62e commit ae685f4

File tree

9 files changed

+113
-88
lines changed

9 files changed

+113
-88
lines changed

.github/workflows/CompatHelper.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,15 @@
11
name: CompatHelper
2-
32
on:
4-
push:
5-
branches:
6-
- master
73
schedule:
8-
- cron: '00 00 * * *'
9-
4+
- cron: 8 16 * * *
105
jobs:
11-
CompatHelper:
6+
build:
127
runs-on: ubuntu-latest
138
steps:
14-
- uses: julia-actions/setup-julia@latest
15-
with:
16-
version: 1.3
179
- name: Pkg.add("CompatHelper")
1810
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
1911
- name: CompatHelper.main()
12+
run: julia -e 'using CompatHelper; CompatHelper.main()'
2013
env:
2114
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22-
run: julia -e 'using CompatHelper; CompatHelper.main()'
15+
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/TagBot.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
name: TagBot
22
on:
3-
schedule:
4-
- cron: 0 * * * *
3+
issue_comment:
4+
types:
5+
- created
6+
workflow_dispatch:
57
jobs:
68
TagBot:
9+
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
710
runs-on: ubuntu-latest
811
steps:
912
- uses: JuliaRegistries/TagBot@v1
1013
with:
1114
token: ${{ secrets.GITHUB_TOKEN }}
15+
ssh: ${{ secrets.DOCUMENTER_KEY }}

.github/workflows/ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: "master"
6+
tags: ["*"]
7+
pull_request:
8+
release:
9+
10+
jobs:
11+
test:
12+
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }}
13+
runs-on: ${{ matrix.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
julia-version:
18+
- "1.0"
19+
- "1"
20+
- "nightly"
21+
os:
22+
- ubuntu-latest
23+
- macos-latest
24+
- windows-latest
25+
julia-arch:
26+
- x64
27+
steps:
28+
- uses: actions/checkout@v2
29+
- uses: julia-actions/setup-julia@v1
30+
with:
31+
version: ${{ matrix.julia-version }}
32+
arch: ${{ matrix.julia-arch }}
33+
- name: Cache artifacts
34+
uses: actions/cache@v2
35+
env:
36+
cache-name: cache-artifacts
37+
with:
38+
path: |
39+
~/.julia/artifacts
40+
~/.julia/registries
41+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
42+
restore-keys: |
43+
${{ runner.os }}-test-${{ env.cache-name }}-
44+
${{ runner.os }}-test-
45+
${{ runner.os }}-
46+
- uses: julia-actions/julia-buildpkg@latest
47+
- uses: julia-actions/julia-runtest@latest
48+
- uses: julia-actions/julia-uploadcodecov@v0.1
49+
continue-on-error: true
50+
- uses: julia-actions/julia-uploadcoveralls@v0.1
51+
continue-on-error: true
52+
53+
Documentation:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: julia-actions/setup-julia@latest
58+
with:
59+
version: 1
60+
- name: Cache artifacts
61+
uses: actions/cache@v2
62+
env:
63+
cache-name: cache-artifacts
64+
with:
65+
path: |
66+
~/.julia/artifacts
67+
~/.julia/registries
68+
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/docs/Project.toml') }}
69+
restore-keys: |
70+
${{ runner.os }}-test-${{ env.cache-name }}-
71+
${{ runner.os }}-test-
72+
${{ runner.os }}-
73+
- uses: julia-actions/julia-docdeploy@releases/v1
74+
env:
75+
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}

.travis.yml

Lines changed: 0 additions & 18 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
# UnitfulAstro.jl
22

3-
UnitfulAstro.jl is an extension of [Unitful.jl](https://github.com/ajkeller34/Unitful.jl) to include
3+
UnitfulAstro.jl is an extension of [Unitful.jl](https://github.com/PainterQubits/Unitful.jl) to include
44
units commonly encountered in astronomy.
55

6-
[![Build Status](https://travis-ci.org/JuliaAstro/UnitfulAstro.jl.svg?branch=master)](https://travis-ci.org/JuliaAstro/UnitfulAstro.jl)
7-
[![Build Status](https://ci.appveyor.com/api/projects/status/9tgicxbo6ud533hp/branch/master?svg=true)](https://ci.appveyor.com/project/mweastwood/unitfulastro-jl/branch/master)
6+
[![CI](https://github.com/JuliaAstro/UnitfulAstro.jl/actions/workflows/ci.yml/badge.svg)](https://github.com/JuliaAstro/UnitfulAstro.jl/actions/workflows/ci.yml)
87

98
**Author:** Michael Eastwood
109

appveyor.yml

Lines changed: 0 additions & 43 deletions
This file was deleted.

docs/Project.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[deps]
2+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
3+
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"
4+
5+
[compat]
6+
Documenter = "0.27"

docs/make.jl

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,20 @@
11
using Documenter, UnitfulAstro
22

33
makedocs(
4-
format = :html,
4+
format = Documenter.HTML(prettyurls = !("local" in ARGS)),
55
sitename = "UnitfulAstro.jl",
66
authors = "Michael Eastwood",
77
linkcheck = true,
88
linkcheck_ignore = [r"assets/.+.pdf"],
9-
html_prettyurls = !("local" in ARGS),
109
pages = [
1110
"Home" => "index.md"
1211
]
1312
)
1413

1514
deploydocs(
1615
repo = "github.com/JuliaAstro/UnitfulAstro.jl.git",
17-
julia = "0.6",
18-
osname = "linux",
1916
target = "build",
2017
deps = nothing,
21-
make = nothing
18+
make = nothing,
2219
)
2320

docs/src/index.md

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ julia> uconvert(u"Jy", 1.23e-20 * u"erg/s/cm^2/Hz")
4949
1230.0000000000002 Jy
5050
5151
julia> uconvert(u"ly", 1 * u"pc")
52-
3.2615637771674337 ly
52+
3.2615637771674333 ly
5353
```
5454

5555
## Magnitudes
@@ -101,7 +101,7 @@ julia> 5*u.g_mag + 10*u.Jy # magnitudes can be mixed with ordinary linear units
101101
julia> uconvert(u.AB_mag, 1*u.μJy) # converting one μJy to AB magnitudes
102102
23.90006562228223 AB mag
103103
104-
julia> uconvert(u.mag_bol, 1*u.Ssun) # apparent bolometric magnitude of the Sun
104+
julia> uconvert(u.bol_mag, 1*u.Ssun) # apparent bolometric magnitude of the Sun
105105
-26.83199694276591 bol mag
106106
107107
julia> uconvert(u.bol_Mag, 1*u.Lsun) # absolute bolometric magnitude of the Sun
@@ -112,21 +112,33 @@ julia> uconvert(u.bol_Mag, 1*u.Lsun) # absolute bolometric magnitude of the Sun
112112
[Color index](https://en.wikipedia.org/wiki/Color_index) is also supported
113113

114114
```jldoctest
115+
julia> using UnitfulAstro
116+
117+
julia> u = UnitfulAstro;
118+
115119
julia> 1u.B_mag - 0.5u.V_mag
116-
0.5000000000000002
120+
0.4999999999999999
117121
```
118122
**Note:** that the only operation that can happen between different bands is subtraction
119123
```jldoctest
124+
julia> using UnitfulAstro
125+
126+
julia> u = UnitfulAstro;
127+
120128
julia> 1u.B_mag + 0.5u.V_mag
121-
ERROR: MagnitudeError: an invalid operation was attempted with magnitudes: 1.0000000000000002 Johnson B mag, 0.5 Johnson V mag
129+
ERROR: MagnitudeError: an invalid operation was attempted with magnitudes: 0.9999999999999999 Johnson B mag, 0.5 Johnson V mag
122130
```
123131
**and** that `+` and `-` work on individual bands
124132
```jldoctest
133+
julia> using UnitfulAstro
134+
135+
julia> u = UnitfulAstro;
136+
125137
julia> 1u.B_mag - 1.5u.B_mag
126-
2.082308583340621 Johnson B mag
138+
2.0823085833406205 Johnson B mag
127139
128140
julia> 1u.B_mag + 1.5u.B_mag
129-
0.46889349301415095 Johnson B mag
141+
0.46889349301415084 Johnson B mag
130142
```
131143

132144
## IAU Resolutions

0 commit comments

Comments
 (0)