Skip to content

Commit

Permalink
Merge pull request #31 from RelationalAI-oss/nhd-workflow-yml
Browse files Browse the repository at this point in the history
Copy GitHub workflow files from Example.jl
  • Loading branch information
NHDaly authored Jul 6, 2022
2 parents 34bfa29 + 040a650 commit 041c7e1
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: TagBot
on:
schedule:
- cron: 0 * * * *
jobs:
TagBot:
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: CI
on:
push:
branches: [master]
tags: ["*"]
pull_request:
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.0'
- '1' # automatically expands to the latest stable 1.x release of Julia
- nightly
os:
- ubuntu-latest
arch:
- x64
- x86
include:
# test macOS and Windows with latest Julia only
- os: macOS-latest
arch: x64
version: 1
- os: windows-latest
arch: x64
version: 1
- os: windows-latest
arch: x86
version: 1
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@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v1
with:
file: lcov.info
# docs:
# name: Documentation
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: julia-actions/julia-buildpkg@latest
# - uses: julia-actions/julia-docdeploy@latest
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
14 changes: 7 additions & 7 deletions test/rematch.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Compat.Test
using Compat.InteractiveUtils
using Test
using Rematch
import Rematch: MatchFailure

Expand Down Expand Up @@ -199,16 +198,17 @@ end
infer1(x) = @match x begin
(a, b..., c) => a
end
@test @code_typed(infer1((:ok,2,3,4)))[2] == Symbol
@test @inferred(infer1((:ok,2,3,4))) == :ok

infer2(x) = @match x begin
(a, b..., c) => c
end

if VERSION >= v"0.7.0-DEV"
@test @code_typed(infer2((1,2,3,:ok)))[2] == Symbol
@test @inferred(infer2((1,2,3,:ok))) == :ok
else
# can't infer x[4-0] - fixed in Julia 0.7
@test_broken @code_typed(infer2((1,2,3,:ok)))[2] == Symbol
@test_broken @inferred(infer2((1,2,3,:ok))) == :ok
end
end

Expand All @@ -218,13 +218,13 @@ end
Foo(_,y::Symbol) => y
Foo(x::Symbol,_) => x
end
@test @code_typed(infer3(Foo(1,2)))[2] == Symbol
@test @inferred(infer3(Foo(1,:ok))) == :ok
infer4(foo) = @match foo begin
Foo(x,y::Symbol) => y
Foo(x::Symbol,y) => x
end
# TODO should we `let` in branches rather than exporting variables?
@test_broken @code_typed(infer4(Foo(1,2)))[2] == Symbol
@test_broken @inferred(infer4(Foo(1,:ok))) == :ok
end

@testset "Nested Guards" begin
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TestRematch

using Compat.Test
using Test

@testset "Rematch.jl" begin
include("rematch.jl")
Expand Down

0 comments on commit 041c7e1

Please sign in to comment.