Skip to content

Commit

Permalink
Use Cirrus to run CI on more platforms (#46)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
giordano authored Feb 18, 2023
1 parent 64abc80 commit 259dc04
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 11 deletions.
53 changes: 53 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
@@ -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
21 changes: 10 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: CI

on:
pull_request:
branches:
Expand All @@ -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 }}
Expand All @@ -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
Expand Down

2 comments on commit 259dc04

@DilumAluthge
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/78066

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.3.0 -m "<description of version>" 259dc047e11ee326b7d2cac63cb09ceeb8f4711b
git push origin v1.3.0

Please sign in to comment.