From 038d0f858278fd53239cd338e4023e3a4aaf648f Mon Sep 17 00:00:00 2001 From: kimikage Date: Wed, 16 Dec 2020 12:48:55 +0900 Subject: [PATCH 1/2] Use GitHub Actions for unit testing on Arm arch. The test runs on a docker container with QEMU. This also updates TagBot.yml. --- .github/workflows/TagBot.yml | 7 ++-- .github/workflows/UnitTest.yml | 4 +-- .github/workflows/UnitTestArm.yml | 59 +++++++++++++++++++++++++++++++ .travis.yml | 15 -------- test/runtests.jl | 6 ++-- 5 files changed, 69 insertions(+), 22 deletions(-) create mode 100644 .github/workflows/UnitTestArm.yml delete mode 100644 .travis.yml diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index d77d3a0c..778c06fe 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,9 +1,12 @@ name: TagBot on: - schedule: - - cron: 0 * * * * + issue_comment: + types: + - created + workflow_dispatch: jobs: TagBot: + if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' runs-on: ubuntu-latest steps: - uses: JuliaRegistries/TagBot@v1 diff --git a/.github/workflows/UnitTest.yml b/.github/workflows/UnitTest.yml index 24695405..8032ea37 100644 --- a/.github/workflows/UnitTest.yml +++ b/.github/workflows/UnitTest.yml @@ -38,7 +38,7 @@ jobs: env: cache-name: cache-artifacts with: - path: ~/.julia/artifacts + path: ~/.julia/artifacts key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} restore-keys: | ${{ runner.os }}-test-${{ env.cache-name }}- @@ -51,5 +51,3 @@ jobs: - uses: codecov/codecov-action@v1 with: file: lcov.info - - diff --git a/.github/workflows/UnitTestArm.yml b/.github/workflows/UnitTestArm.yml new file mode 100644 index 00000000..9a0e8166 --- /dev/null +++ b/.github/workflows/UnitTestArm.yml @@ -0,0 +1,59 @@ +name: Unit test for Arm + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: +jobs: + test: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + julia-version: ['1.0', '1', 'nightly'] + os: [ubuntu-20.04] + distro: [ubuntu20.04] + arch: [aarch64] + + steps: + - uses: actions/checkout@v2 + + - name: Download Julia Binary + # FIXME + run: | + cd /tmp + case "${{ matrix.julia-version }}" in + "1.0" ) + wget -nv https://julialang-s3.julialang.org/bin/linux/aarch64/1.0/julia-1.0.5-linux-aarch64.tar.gz + ;; + "1" ) + wget -nv https://julialang-s3.julialang.org/bin/linux/aarch64/1.5/julia-1.5.3-linux-aarch64.tar.gz + ;; + "nightly" ) + wget -nv https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linuxaarch64.tar.gz + ;; + esac + tar -xzf julia-*aarch64.tar.gz -C /home/runner/work/ + mv /home/runner/work/julia-*/ /home/runner/work/julia/ + rm julia-*aarch64.tar.gz + - uses: uraimo/run-on-arch-action@v2.0.7 + name: Unit Test + with: + arch: ${{ matrix.arch }} + distro: ${{ matrix.distro }} + dockerRunArgs: | + -v "/home/runner/work/julia:/home/runner/work/julia" + --net=host + install: | + ln -s /home/runner/work/julia/bin/julia /usr/local/bin/julia + echo /home/runner/work/julia/lib > /etc/ld.so.conf.d/julia.conf + + run: | + julia -e 'using InteractiveUtils; versioninfo();' + julia --project=. --check-bounds=yes --color=yes -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)' + - uses: julia-actions/julia-processcoverage@v1 + - uses: codecov/codecov-action@v1 + with: + file: lcov.info diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index aff8557d..00000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -language: julia -os: - - linux -julia: - - 1.0 - - 1 - - nightly -arch: - - arm64 -cache: - directories: - - $HOME/.julia/artifacts -notifications: - email: false -codecov: true diff --git a/test/runtests.jl b/test/runtests.jl index 874813cd..cabb1b17 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -6,8 +6,10 @@ else @test isempty(detect_ambiguities(FixedPointNumbers, Base, Core)) end -using Documenter -doctest(FixedPointNumbers, manual = false) +if Sys.ARCH === :x86_64 || Sys.ARCH === :i686 + using Documenter + doctest(FixedPointNumbers, manual = false) +end @testset "normed" begin include("normed.jl") From e933aeb44fa2c84cfaeaf0bc9473c2db3c9f8ac4 Mon Sep 17 00:00:00 2001 From: kimikage Date: Thu, 17 Dec 2020 12:09:06 +0900 Subject: [PATCH 2/2] Use JSON release feed --- .github/workflows/UnitTestArm.yml | 37 ++++++++++++++++++------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/.github/workflows/UnitTestArm.yml b/.github/workflows/UnitTestArm.yml index 9a0e8166..f31e3bc2 100644 --- a/.github/workflows/UnitTestArm.yml +++ b/.github/workflows/UnitTestArm.yml @@ -21,23 +21,29 @@ jobs: - uses: actions/checkout@v2 - name: Download Julia Binary - # FIXME + run: > + julia -e ' + using Pkg; Pkg.add("JSON"); using JSON; + if "${{ matrix.julia-version }}" == "nightly"; + url = "https://julialangnightlies-s3.julialang.org/bin/linux/${{ matrix.arch }}/julia-latest-linux${{ matrix.arch }}.tar.gz"; + else; + path = download("https://julialang-s3.julialang.org/bin/versions.json"); + json = JSON.parsefile(path); + rm(path); + a(f) = f["arch"] == "${{ matrix.arch }}" && f["os"] == "linux" && !occursin("musl", f["triplet"]); + m = filter(json) do v; VersionNumber(v[1]) in Pkg.Types.VersionSpec("${{ matrix.julia-version }}") && any(a, v[2]["files"]); end; + v = sort(VersionNumber.(keys(m)))[end]; + url = filter(a, json[string(v)]["files"])[1]["url"]; + end; + download(url, "/tmp/julia-aarch64.tar.gz");' + + - name: Extract Julia Files run: | cd /tmp - case "${{ matrix.julia-version }}" in - "1.0" ) - wget -nv https://julialang-s3.julialang.org/bin/linux/aarch64/1.0/julia-1.0.5-linux-aarch64.tar.gz - ;; - "1" ) - wget -nv https://julialang-s3.julialang.org/bin/linux/aarch64/1.5/julia-1.5.3-linux-aarch64.tar.gz - ;; - "nightly" ) - wget -nv https://julialangnightlies-s3.julialang.org/bin/linux/aarch64/julia-latest-linuxaarch64.tar.gz - ;; - esac - tar -xzf julia-*aarch64.tar.gz -C /home/runner/work/ + tar -xzf julia-aarch64.tar.gz -C /home/runner/work/ mv /home/runner/work/julia-*/ /home/runner/work/julia/ - rm julia-*aarch64.tar.gz + rm julia-aarch64.tar.gz + - uses: uraimo/run-on-arch-action@v2.0.7 name: Unit Test with: @@ -45,11 +51,12 @@ jobs: distro: ${{ matrix.distro }} dockerRunArgs: | -v "/home/runner/work/julia:/home/runner/work/julia" + -v "/home/runner/.julia/registries/General:/root/.julia/registries/General" --net=host install: | ln -s /home/runner/work/julia/bin/julia /usr/local/bin/julia echo /home/runner/work/julia/lib > /etc/ld.so.conf.d/julia.conf - + mkdir -p /root/.julia/registries/General run: | julia -e 'using InteractiveUtils; versioninfo();' julia --project=. --check-bounds=yes --color=yes -e 'using Pkg; Pkg.build(); Pkg.test(coverage=true)'