Skip to content

[CI] Allow failure on julia nightly #135

[CI] Allow failure on julia nightly

[CI] Allow failure on julia nightly #135

Workflow file for this run

name: CI
on:
pull_request:
branches:
- master
push:
branches:
- master
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
- 'nightly'
os:
- ubuntu-latest
- macOS-14
arch:
- x64
- aarch64
exclude:
- os: ubuntu-latest
arch: aarch64
- os: windows-latest
arch: aarch64
- os: macOS-13
arch: aarch64
- os: macOS-14
arch: x64
- os: macOS-14
version: '1.6'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
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/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
if: matrix.version != 'nightly' # Only process coverage on non-nightly builds
- uses: codecov/codecov-action@v4
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
if: matrix.version != 'nightly' # Only send coverage for non-nightly builds
docs:
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: |
julia --project=docs -e '
using Pkg
Pkg.develop(PackageSpec(path=pwd()))
Pkg.instantiate()'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}
report-status:
runs-on: ubuntu-latest
needs: [test, docs]
if: always()
steps:
- name: Report CI Status
uses: actions/github-script@v7
with:
script: |
// Fetch the jobs for the workflow run
const jobs = await github.rest.actions.listJobsForWorkflowRun({
owner: context.repo.owner,
repo: context.repo.repo,
run_id: context.runId,
});
// Check if any non-nightly jobs failed
let state = 'success'; // Default state
for (const job of jobs.data.jobs) {
if (job.conclusion !== 'success' && !job.name.includes('nightly')) {
state = 'failure';
break;
}
}
// Create a commit status based on the job results
await github.rest.repos.createCommitStatus({
owner: context.repo.owner,
repo: context.repo.repo,
sha: context.sha,
state: state, // 'success' or 'failure'
target_url: `${context.payload.repository.html_url}/actions/runs/${context.runId}`,
description: 'CI workflow concluded',
context: 'CI Workflow Status'
});