From 259dc047e11ee326b7d2cac63cb09ceeb8f4711b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mos=C3=A8=20Giordano?= Date: Sat, 18 Feb 2023 00:29:02 +0000 Subject: [PATCH] Use Cirrus to run CI on more platforms (#46) * Use Cirrus to run CI on more platforms * Modernise GitHub workflows * Do not Cirrus on nightly * Better script for Cirrus, from VideoIO * Autocancel GitHub Actions if there are more recent commits on branch * Use eager registry on Cirrus CI * Do not run CI with Julia v1.6 on FreeBSD --- .cirrus.yml | 53 ++++++++++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 21 ++++++++-------- 2 files changed, 63 insertions(+), 11 deletions(-) create mode 100644 .cirrus.yml diff --git a/.cirrus.yml b/.cirrus.yml new file mode 100644 index 0000000..6364e2c --- /dev/null +++ b/.cirrus.yml @@ -0,0 +1,53 @@ +task: + matrix: + - name: FreeBSD + freebsd_instance: + image_family: freebsd-13-1 + env: + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + matrix: + # - JULIA_VERSION: 1.6 # Has problems with libcurl + - JULIA_VERSION: 1 + # - JULIA_VERSION: nightly # not available + - name: Linux ARMv8 + arm_container: + image: ubuntu:latest + env: + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + matrix: + - JULIA_VERSION: 1.6 + - JULIA_VERSION: 1 + - JULIA_VERSION: nightly + - name: MacOS M1 + macos_instance: + image: ghcr.io/cirruslabs/macos-monterey-base:latest + env: + JULIA_PKG_SERVER_REGISTRY_PREFERENCE: eager + matrix: + # - JULIA_VERSION: 1.6 # not available + - JULIA_VERSION: 1 + - JULIA_VERSION: nightly + + allow_failures: $JULIA_VERSION == 'nightly' + install_script: | + URL="https://raw.githubusercontent.com/ararslan/CirrusCI.jl/master/bin/install.sh" + set -x + if [ "$(uname -s)" = "Linux" ] && command -v apt; then + apt update + apt install -y curl + fi + if command -v curl; then + sh -c "$(curl ${URL})" + elif command -v wget; then + sh -c "$(wget ${URL} -O-)" + elif command -v fetch; then + sh -c "$(fetch ${URL} -o -)" + else + echo "No downloader installed! :( Install one! :)" + fi + build_script: + - cirrusjl build + test_script: + - cirrusjl test + coverage_script: + - cirrusjl coverage codecov diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b58d1bc..180c45d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,4 +1,5 @@ name: CI + on: pull_request: branches: @@ -7,6 +8,13 @@ on: branches: - master tags: '*' + +concurrency: + # Skip intermediate builds: always. + # Cancel intermediate builds: always. + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} @@ -30,21 +38,12 @@ jobs: - os: macOS-latest arch: x86 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - uses: julia-actions/setup-julia@v1 with: version: ${{ matrix.version }} arch: ${{ matrix.arch }} - - uses: actions/cache@v2 - env: - cache-name: cache-artifacts - with: - path: ~/.julia/artifacts - key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }} - restore-keys: | - ${{ runner.os }}-test-${{ env.cache-name }}- - ${{ runner.os }}-test- - ${{ runner.os }}- + - uses: julia-actions/cache@v1 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 - uses: julia-actions/julia-processcoverage@v1