Skip to content

CI

CI #537

Workflow file for this run

name: CI
on:
merge_group: # GitHub Merge Queue
pull_request:
push:
branches:
- master
tags: '*'
defaults:
run:
shell: bash
concurrency:
# Skip intermediate builds: all builds except for builds on the `master` or `release-*` branches
# Cancel intermediate builds: only pull request builds
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.ref != 'refs/heads/master' || startsWith(github.ref, 'refs/heads/release-') || github.run_number }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
jobs:
finalize:
needs: [format, test, docs]
if: always()
runs-on: ubuntu-latest
steps:
- run: |
echo format: ${{ needs.format.result }}
echo test: ${{ needs.test.result }}
echo docs: ${{ needs.docs.result }}
- run: exit 1
# Make sure that every line (except for the last line) ends in `||`.
# Make sure that the last line does NOT end in `||`.
if: |
(needs.format.result != 'success') ||
(needs.test.result != 'success') ||
(needs.docs.result != 'success')
format:
name: Check format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: 1
- name: Install and run JuliaFormatter
run: make format-fix
- uses: reviewdog/action-suggester@v1
with:
tool_name: JuliaFormatter
fail_on_error: true
filter_mode: added
test:
needs: format
name: Julia ${{ matrix.version }} / generate=${{ matrix.generate }} / ${{ matrix.os }} / ${{ matrix.arch }} / ${{ github.event_name }}
runs-on: ${{ matrix.os }}
continue-on-error: ${{ matrix.version == 'nightly' }}
strategy:
fail-fast: false
matrix:
generate:
- 'false'
- 'true'
version:
- '1.4'
- '1'
- 'nightly'
os:
- ubuntu-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- if: ${{ matrix.generate == 'true' }}
run: |
rm -rf src/autogenerated/*
rm -rf ~/.julia
julia --project=.ci/generate .ci/generate/develop.jl
julia --project=.ci/generate .ci/generate/generate.jl
- run: rm -rf ~/.julia
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- run: rm -rf src/autogenerated/*
- uses: julia-actions/julia-processcoverage@v1
- uses: codecov/codecov-action@v3
with:
file: lcov.info
docs:
needs: format
name: Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
with:
version: '1'
- run: julia --color=yes -e 'import Pkg; VERSION >= v"1.5-" && !isdir(joinpath(DEPOT_PATH[1], "registries", "General")) && Pkg.Registry.add("General")'
shell: bash
env:
# We set `JULIA_PKG_SERVER` only for this step to enforce
# `Pkg.Registry.add` to use Git. This way, Pkg.jl can send
# the request metadata to pkg.julialang.org when installing
# packages via `Pkg.test`.
JULIA_PKG_SERVER: ""
- run: julia --project=docs docs/develop.jl
- run: |
julia --project=docs -e '
import Documenter
import FHIRClient
import Generate
Documenter.doctest(FHIRClient)'
- run: |
julia --project=docs -e '
import Documenter
import FHIRClient
import Generate
Documenter.doctest(Generate; manual = joinpath(pwd(), "docs", "src"))'
- run: julia --project=docs docs/make.jl
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }}