Skip to content

Commit

Permalink
Run tests on ci
Browse files Browse the repository at this point in the history
  • Loading branch information
simonschoelly committed Oct 9, 2024
1 parent c3c4abd commit d9ff4e8
Show file tree
Hide file tree
Showing 5 changed files with 138 additions and 2 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/ReusableTest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Reusable test

on:
workflow_call:
inputs:
version:
required: false
type: string
default: "1"
os:
required: false
type: string
default: ubuntu-latest
arch:
required: false
type: string
default: x64
allow_failure:
required: false
type: boolean
default: false
run_codecov:
required: false
type: boolean
default: false
secrets:
# TODO set required to true when we enable codecov
codecov_token:
required: false

jobs:
test:
name: Julia ${{ inputs.version }} - ${{ inputs.os }} - ${{ inputs.arch }} - ${{ github.event_name }}
runs-on: ${{ inputs.os }}
continue-on-error: ${{ inputs.allow_failure }}

steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v2
with:
version: ${{ inputs.version }}
arch: ${{ inputs.arch }}
- name: Use Julia cache
uses: julia-actions/cache@v2
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
if: ${{ inputs.run_codecov }}
- uses: codecov/codecov-action@v4
if: ${{ inputs.run_codecov }}
with:
file: lcov.info
token: ${{ secrets.codecov_token }}
63 changes: 63 additions & 0 deletions .github/workflows/Test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

on:
push:
branches:
- main
tags: ["*"]
pull_request:
branches:
- master
paths:
- "src/**"
- "test/**"
- "ext/**"
- "*.toml"
types: [opened, synchronize, reopened]
workflow_dispatch:

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}


jobs:
test:
uses: ./.github/workflows/ReusableTest.yml
with:
os: ${{ matrix.os }}
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
allow_failure: ${{ matrix.allow_failure }}
# TODO enable codecov
run_codecov: false
# run_codecov: ${{ matrix.version == '1' && matrix.os == 'ubuntu-latest' }}
secrets:
codecov_token: ${{ secrets.CODECOV_TOKEN }}
strategy:
fail-fast: false
matrix:
version:
- "1.9" # min version
- "1.10" # LTS
- "1"
os:
- ubuntu-latest
- macOS-latest
#- windows-latest
arch:
- x64
allow_failure: [false]

include:
- version: "nightly"
os: ubuntu-latest
arch: x64
allow_failure: true
- version: "nightly"
os: macOS-latest
arch: x64
allow_failure: true

13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
*.jl.*.cov
*.jl.cov
*.jl.mem
*.rej
.DS_Store
.benchmarkci
Manifest.toml
.swp
.swo
benchmark/*.json
coverage
docs/build/
env
node_modules
2 changes: 2 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
9 changes: 9 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using KittyTerminalImages
using Test


@testset "KittyTerminalImages.jl" begin
# TODO add some real tests
@test true
end

0 comments on commit d9ff4e8

Please sign in to comment.