From 5ea7b30ef162a5219468dd0c8be2f71b3f71cef5 Mon Sep 17 00:00:00 2001 From: Nicolae Filat Date: Tue, 15 Aug 2023 22:06:05 +0300 Subject: [PATCH] Added pipeline and refactored the test folder --- .github/workflows/CI.yml | 35 ++++++++++++++++++++++++++++++ .github/workflows/CompatHelper.yml | 16 ++++++++++++++ .github/workflows/TagBot.yml | 31 ++++++++++++++++++++++++++ {tests => test}/runtests.jl | 6 +++-- 4 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/CI.yml create mode 100644 .github/workflows/CompatHelper.yml create mode 100644 .github/workflows/TagBot.yml rename {tests => test}/runtests.jl (72%) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 0000000..53f53a8 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,35 @@ +name: CI +on: + push: + branches: + - master + tags: ['*'] + pull_request: +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: + name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + version: + - '1.8' + - 'nightly' + os: + - ubuntu-latest + arch: + - x64 + steps: + - uses: actions/checkout@v3 + - uses: julia-actions/setup-julia@v1 + with: + version: ${{ matrix.version }} + arch: ${{ matrix.arch }} + - uses: julia-actions/cache@v1 + - uses: julia-actions/julia-buildpkg@v1 + - uses: julia-actions/julia-runtest@v1 diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml new file mode 100644 index 0000000..cba9134 --- /dev/null +++ b/.github/workflows/CompatHelper.yml @@ -0,0 +1,16 @@ +name: CompatHelper +on: + schedule: + - cron: 0 0 * * * + workflow_dispatch: +jobs: + CompatHelper: + runs-on: ubuntu-latest + steps: + - name: Pkg.add("CompatHelper") + run: julia -e 'using Pkg; Pkg.add("CompatHelper")' + - name: CompatHelper.main() + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COMPATHELPER_PRIV: ${{ secrets.DOCUMENTER_KEY }} + run: julia -e 'using CompatHelper; CompatHelper.main()' diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml new file mode 100644 index 0000000..2bacdb8 --- /dev/null +++ b/.github/workflows/TagBot.yml @@ -0,0 +1,31 @@ +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: + token: ${{ secrets.GITHUB_TOKEN }} + ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/tests/runtests.jl b/test/runtests.jl similarity index 72% rename from tests/runtests.jl rename to test/runtests.jl index 793d34a..3d9af72 100644 --- a/tests/runtests.jl +++ b/test/runtests.jl @@ -11,7 +11,9 @@ using Test @testset "Simple test_with_input (x * x + 2)" begin tab = Dict{Symbol,Any}(:+ => +, :* => *) - input_dict = Dict(:x => 3) - @test test_with_input(tab, :(x * x + 2), input_dict) == 3 * 3 + 2 + input = 3 + f(x) = x * x + 2 + input_dict = Dict(:x => input,:f => f) + @test test_with_input(tab, :(f(x)), input_dict) == f(input) end end