Skip to content

Commit

Permalink
Move CI to GitHub Actions (#27)
Browse files Browse the repository at this point in the history
  • Loading branch information
giordano authored Nov 29, 2021
1 parent f3de62e commit ae685f4
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 88 deletions.
15 changes: 4 additions & 11 deletions .github/workflows/CompatHelper.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
name: CompatHelper

on:
push:
branches:
- master
schedule:
- cron: '00 00 * * *'

- cron: 8 16 * * *
jobs:
CompatHelper:
build:
runs-on: ubuntu-latest
steps:
- uses: julia-actions/setup-julia@latest
with:
version: 1.3
- name: Pkg.add("CompatHelper")
run: julia -e 'using Pkg; Pkg.add("CompatHelper")'
- name: CompatHelper.main()
run: julia -e 'using CompatHelper; CompatHelper.main()'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: julia -e 'using CompatHelper; CompatHelper.main()'
COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }}
8 changes: 6 additions & 2 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
issue_comment:
types:
- created
workflow_dispatch:
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
75 changes: 75 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: CI

on:
push:
branches: "master"
tags: ["*"]
pull_request:
release:

jobs:
test:
name: Julia ${{ matrix.julia-version }} - ${{ matrix.os }} - ${{ matrix.julia-arch }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
julia-version:
- "1.0"
- "1"
- "nightly"
os:
- ubuntu-latest
- macos-latest
- windows-latest
julia-arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
arch: ${{ matrix.julia-arch }}
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: |
~/.julia/artifacts
~/.julia/registries
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@latest
- uses: julia-actions/julia-runtest@latest
- uses: julia-actions/[email protected]
continue-on-error: true
- uses: julia-actions/[email protected]
continue-on-error: true

Documentation:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@latest
with:
version: 1
- name: Cache artifacts
uses: actions/cache@v2
env:
cache-name: cache-artifacts
with:
path: |
~/.julia/artifacts
~/.julia/registries
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/docs/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-docdeploy@releases/v1
env:
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
18 changes: 0 additions & 18 deletions .travis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# UnitfulAstro.jl

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

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

**Author:** Michael Eastwood

Expand Down
43 changes: 0 additions & 43 deletions appveyor.yml

This file was deleted.

6 changes: 6 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
Unitful = "1986cc42-f94f-5a68-af5c-568840ba703d"

[compat]
Documenter = "0.27"
7 changes: 2 additions & 5 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,23 +1,20 @@
using Documenter, UnitfulAstro

makedocs(
format = :html,
format = Documenter.HTML(prettyurls = !("local" in ARGS)),
sitename = "UnitfulAstro.jl",
authors = "Michael Eastwood",
linkcheck = true,
linkcheck_ignore = [r"assets/.+.pdf"],
html_prettyurls = !("local" in ARGS),
pages = [
"Home" => "index.md"
]
)

deploydocs(
repo = "github.com/JuliaAstro/UnitfulAstro.jl.git",
julia = "0.6",
osname = "linux",
target = "build",
deps = nothing,
make = nothing
make = nothing,
)

24 changes: 18 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ julia> uconvert(u"Jy", 1.23e-20 * u"erg/s/cm^2/Hz")
1230.0000000000002 Jy
julia> uconvert(u"ly", 1 * u"pc")
3.2615637771674337 ly
3.2615637771674333 ly
```

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

```jldoctest
julia> using UnitfulAstro
julia> u = UnitfulAstro;
julia> 1u.B_mag - 0.5u.V_mag
0.5000000000000002
0.4999999999999999
```
**Note:** that the only operation that can happen between different bands is subtraction
```jldoctest
julia> using UnitfulAstro
julia> u = UnitfulAstro;
julia> 1u.B_mag + 0.5u.V_mag
ERROR: MagnitudeError: an invalid operation was attempted with magnitudes: 1.0000000000000002 Johnson B mag, 0.5 Johnson V mag
ERROR: MagnitudeError: an invalid operation was attempted with magnitudes: 0.9999999999999999 Johnson B mag, 0.5 Johnson V mag
```
**and** that `+` and `-` work on individual bands
```jldoctest
julia> using UnitfulAstro
julia> u = UnitfulAstro;
julia> 1u.B_mag - 1.5u.B_mag
2.082308583340621 Johnson B mag
2.0823085833406205 Johnson B mag
julia> 1u.B_mag + 1.5u.B_mag
0.46889349301415095 Johnson B mag
0.46889349301415084 Johnson B mag
```

## IAU Resolutions
Expand Down

2 comments on commit ae685f4

@giordano
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/49563

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.0 -m "<description of version>" ae685f4f74ef11fccf8120fe73a857e9285baae9
git push origin v1.1.0

Please sign in to comment.