Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump julia-actions/cache from 1 to 2 #1

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
project:
default:
informational: true
patch:
default:
informational: true
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/" # Location of package manifests
schedule:
interval: "monthly"
41 changes: 41 additions & 0 deletions .github/workflows/TagBot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: TagBot
on:
issue_comment:
types:
- created
workflow_dispatch:
inputs:
lookback:
default: '3'
permissions:
actions: read
checks: read
contents: write
deployments: read
issues: read
discussions: read
packages: read
pages: read
pull-requests: read
repository-projects: read
security-events: read
statuses: read
jobs:
TagBot:
if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'
runs-on: ubuntu-latest
steps:
- uses: JuliaRegistries/TagBot@v1
with:
changelog: |
{% if custom %}
{{ custom }}
{% endif %}

See [`CHANGELOG.md`](https://github.com/fredrikekre/Prometheus.jl/blob/master/CHANGELOG.md) for notable changes.

{% if previous_release %}
[Diff since {{ previous_release }}]({{ compare_url }})
{% endif %}
token: ${{ secrets.GITHUB_TOKEN }}
ssh: ${{ secrets.DOCUMENTER_KEY }}
44 changes: 44 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Test

on:
push:
branches:
- 'master'
- 'release-'
tags:
- '*'
pull_request:

jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
version:
- '1.6'
- '1.7'
- '1.8'
- '1.9'
- '1'
- 'nightly'
os:
- ubuntu-latest
include:
- os: windows-latest
version: '1'
- os: macOS-latest
version: '1'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ matrix.version }}
- uses: julia-actions/cache@v2
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v4
with:
file: lcov.info
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
6 changes: 6 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,9 @@ JuliaSyntax = "70703baa-626e-46a2-a12c-08ffd08c73b4"

[compat]
JuliaSyntax = "0.4.8"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[target]
test = ["Test"]
62 changes: 62 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
using Runic:
format_string
using Test:
@test, @testset

@testset "Hex/oct/bin literal integers" begin
z(n) = "0"^n
test_cases = [
# Hex UInt8
("0x" * z(n) * "1" => "0x01" for n in 0:1)...,
# Hex UInt16
("0x" * z(n) * "1" => "0x0001" for n in 2:3)...,
# Hex UInt32
("0x" * z(n) * "1" => "0x00000001" for n in 4:7)...,
# Hex UInt64
("0x" * z(n) * "1" => "0x0000000000000001" for n in 8:15)...,
# Hex UInt128
("0x" * z(n) * "1" => "0x" * z(31) * "1" for n in 16:31)...,
# Hex BigInt
("0x" * z(n) * "1" => "0x" * z(n) * "1" for n in 32:35)...,
# Octal UInt8
("0o" * z(n) * "1" => "0o001" for n in 0:2)...,
"0o377" => "0o377", # typemax(UInt8)
# Octal UInt16
"0o400" => "0o000400", # typemax(UInt8) + 1
("0o" * z(n) * "1" => "0o000001" for n in 3:5)...,
"0o177777" => "0o177777", # typemax(UInt16)
# Octal UInt32
"0o200000" => "0o00000200000", # typemax(UInt16) + 1
("0o" * z(n) * "1" => "0o00000000001" for n in 6:10)...,
"0o37777777777" => "0o37777777777", # typemax(UInt32)
# Octal UInt64
"0o40000000000" => "0o0000000000040000000000", # typemax(UInt32) + 1
("0o" * z(n) * "1" => "0o" * z(21) * "1" for n in 11:21)...,
"0o1777777777777777777777" => "0o1777777777777777777777", # typemax(UInt64)
# Octal UInt128
"0o2" * z(21) => "0o" * z(21) * "2" * z(21), # typemax(UInt64) + 1
("0o" * z(n) * "1" => "0o" * z(42) * "1" for n in 22:42)...,
"0o3" * "7"^42 => "0o3" * "7"^42, # typemax(UInt128)
# Octal BigInt
"0o4" * z(42) => "0o4" * z(42), # typemax(UInt128) + 1
"0o7" * z(42) => "0o7" * z(42),
]
# Test the test cases :)
mod = Module()
for (a, b) in test_cases
c = Core.eval(mod, Meta.parse(a))
d = Core.eval(mod, Meta.parse(b))
@test c == d
@test typeof(c) == typeof(d)
end
# Join all cases to a single string so that we only need to call the formatter once
input_str = let io = IOBuffer()
join(io, (case.first for case in test_cases), '\n')
String(take!(io))
end
output_str = let io = IOBuffer()
join(io, (case.second for case in test_cases), '\n')
String(take!(io))
end
@test format_string(input_str) == output_str
end
Loading