diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c73381d34..3abd33ecd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,16 +24,18 @@ jobs: arch: - x64 steps: + - name: Determine if PR is from a fork + run: | + echo "head_ref is: ${{ github.head_ref }}" + echo "target repository is: ${{ github.repository }}" + echo "head repository is: ${{ github.event.pull_request.head.repo.full_name }}" - name: Set integration test flag + if: (github.head_ref == 'dev') && (github.repository == github.event.pull_request.head.repo.full_name) + run: | + echo "MLJ_TEST_INTEGRATION=true" >> "${GITHUB_ENV:?}" + - name: Verify the value of the integration test flag run: | - julia - e ' - open("ENV[\"GITHUB_ENV\"]", "a") do io - name = "MLJ_TEST_INTEGRATION" - value = "true" - line = "$(name)=$(value)" - println(io, line) - end' - if: (${{ github.head_ref }} == "dev") && (${{ github.repository }} == ${{ github.event.pull_request.head.repo.full_name }}) + echo "MLJ_TEST_INTEGRATION is ${MLJ_TEST_INTEGRATION}" - uses: actions/checkout@v2 - uses: julia-actions/setup-julia@v1 with: diff --git a/test/runtests.jl b/test/runtests.jl index 676be5349..5aa99c600 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -20,7 +20,7 @@ end @test include("scitypes.jl") end -if get(ENV, "MLJ_TEST_INTEGRATION", "false") == "true" +if parse(Bool, get(ENV, "MLJ_TEST_INTEGRATION", "false")) @testset "integration" begin @test include("integration.jl") end