Skip to content

Commit

Permalink
Merge pull request #8 from krrutkow/master
Browse files Browse the repository at this point in the history
Use GitHub Actions for CI
  • Loading branch information
krrutkow authored Jun 26, 2020
2 parents 7ebd49e + 6671f12 commit 6ee45b1
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 50 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: CI
on:
- push
- pull_request
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.3'
- '1.4'
os:
- ubuntu-latest
- macOS-latest
# - windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v2
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v1
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
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
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# PLCTag.jl

[![Linux & OSX](https://travis-ci.com/libplctag/PLCTag.jl.svg?branch=master)](https://travis-ci.com/libplctag/PLCTag.jl)
[![Build Status](https://github.com/libplctag/PLCTag.jl/workflows/CI/badge.svg)](https://github.com/libplctag/PLCTag.jl/actions)

Julia wrapper for [libplctag](https://github.com/libplctag/libplctag) to communicate with PLC's.

Expand Down
84 changes: 48 additions & 36 deletions deps/build.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,40 +5,58 @@ using CBindingGen
BinDeps.@setup

version = get(ENV, "LIBPLCTAG_VERSION", "2.1.6")
plctag = library_dependency("libplctag")

rm(BinDeps.srcdir(plctag); force = true, recursive = true)
rm(BinDeps.usrdir(plctag); force = true, recursive = true)

provides(
Sources,
URI("https://github.com/libplctag/libplctag/archive/v$(version).tar.gz"),
plctag,
unpacked_dir = "libplctag-$(version)",
)

srcdir = joinpath(BinDeps.srcdir(plctag), "libplctag-$(version)")
blddir = joinpath(srcdir, "build")
lib = joinpath(BinDeps.libdir(plctag), Sys.isapple() ? "libplctag.dylib" : "libplctag.so")
provides(
BuildProcess,
@build_steps(begin
GetSources(plctag)
CMakeBuild(
srcdir = srcdir,
builddir = blddir,
prefix = BinDeps.usrdir(plctag),
installed_libpath = [lib],
)
end),
plctag,
)
plctag = library_dependency("libplctag", aliases = ["plctag"])
if Sys.iswindows()
bindir = joinpath(BinDeps.depsdir(plctag), plctag.name)
lib = joinpath(bindir, "Release", "plctag.dll")

rm(bindir; force = true, recursive = true)

provides(
Binaries,
URI("https://github.com/libplctag/libplctag/releases/download/v$(version)/libplctag_$(version)_windows_x86.zip"),
plctag,
installed_libpath = lib,
unpacked_dir = ".",
)
else
srcdir = joinpath(BinDeps.srcdir(plctag), "libplctag-$(version)")
blddir = joinpath(srcdir, "build")
lib = joinpath(BinDeps.libdir(plctag), Sys.isapple() ? "libplctag.dylib" : "libplctag.so")

rm(BinDeps.srcdir(plctag); force = true, recursive = true)
rm(BinDeps.usrdir(plctag); force = true, recursive = true)

provides(
Sources,
URI("https://github.com/libplctag/libplctag/archive/v$(version).tar.gz"),
plctag,
unpacked_dir = srcdir,
)

provides(
BuildProcess,
@build_steps(begin
GetSources(plctag)
CMakeBuild(
srcdir = srcdir,
builddir = blddir,
prefix = BinDeps.usrdir(plctag),
installed_libpath = [lib],
)
end),
plctag,
)

open(joinpath(@__DIR__, "ab_server.jl"), "w+") do io
println(io, "const AB_SERVER_BIN = $(repr(joinpath(blddir, "bin_dist", "ab_server")))")
end
end

BinDeps.@install Dict(:plctag => :_plctag)



incdir = joinpath(BinDeps.usrdir(plctag), "include")
incdir = Sys.iswindows() ? bindir : BinDeps.includedir(plctag)
cvts = convert_header("libplctag.h", args = ["-I", incdir, "-fparse-all-comments"]) do cursor
header = CodeLocation(cursor).file
name = string(cursor)
Expand All @@ -52,9 +70,3 @@ end
open(joinpath(@__DIR__, "libplctag.jl"), "w+") do io
generate(io, lib => cvts)
end


open(joinpath(@__DIR__, "ab_server.jl"), "w+") do io
println(io, "const AB_SERVER_BIN = $(repr(joinpath(blddir, "bin_dist", "ab_server")))")
end

3 comments on commit 6ee45b1

@krrutkow
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@krrutkow
Copy link
Contributor 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/17059

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 v0.1.0 -m "<description of version>" 6ee45b1c604f2fc55e276242a0c96c56fd257007
git push origin v0.1.0

Please sign in to comment.