CI #2773
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
merge_group: | |
push: | |
branches: | |
- master # Allows codecov to receive current HEAD information for each commit merged into master | |
pull_request: | |
branches: | |
- master | |
schedule: | |
- cron: '15 1 * * *' # Nightly at 01:15 | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
check_spelling: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Check Spelling | |
uses: crate-ci/[email protected] | |
check_format: | |
strategy: | |
matrix: | |
crystal: | |
- latest | |
- nightly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- name: Check Format | |
run: crystal tool format --check | |
coding_standards: | |
runs-on: ubuntu-latest | |
container: | |
image: crystallang/crystal:latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Dependencies | |
run: shards install | |
env: | |
SHARDS_OVERRIDE: shard.dev.yml | |
- name: Ameba | |
run: ./bin/ameba | |
test_compiled: | |
strategy: | |
fail-fast: false | |
matrix: | |
crystal: | |
- latest | |
- nightly | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install kcov | |
if: matrix.crystal == 'nightly' | |
run: | | |
sudo apt-get update && | |
sudo apt-get install binutils-dev libssl-dev libcurl4-openssl-dev libelf-dev libstdc++-12-dev zlib1g-dev libdw-dev libiberty-dev | |
curl -L -o ./kcov.tar.gz https://github.com/SimonKagstrom/kcov/archive/refs/tags/v43.tar.gz && | |
mkdir kcov-source && | |
tar xzf kcov.tar.gz -C kcov-source --strip-components=1 && | |
cd kcov-source && | |
mkdir build && | |
cd build && | |
cmake .. && | |
make -j$(nproc) && | |
sudo make install | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- name: Install Dependencies | |
run: shards install --skip-postinstall --skip-executables | |
env: | |
SHARDS_OVERRIDE: shard.dev.yml | |
- name: Compiled Specs | |
run: ./scripts/test.sh all compiled | |
shell: bash | |
- uses: codecov/codecov-action@v5 | |
if: matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: coverage | |
files: '**/cov.xml' # There is no `unreachable.codecov.json` file when running _only_ compiled specs | |
flags: compiled | |
verbose: true | |
- uses: codecov/test-results-action@v1 | |
if: matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: coverage | |
files: '**/junit.xml' | |
flags: compiled | |
verbose: true | |
test_unit: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-latest | |
- windows-latest | |
crystal: | |
- latest | |
- nightly | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
if: github.event_name != 'pull_request' | |
- uses: actions/checkout@v4 | |
if: github.event_name == 'pull_request' | |
with: | |
fetch-depth: 0 | |
- name: Install kcov | |
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly' | |
run: | | |
sudo apt-get update && | |
sudo apt-get install binutils-dev libssl-dev libcurl4-openssl-dev libelf-dev libstdc++-12-dev zlib1g-dev libdw-dev libiberty-dev | |
curl -L -o ./kcov.tar.gz https://github.com/SimonKagstrom/kcov/archive/refs/tags/v43.tar.gz && | |
mkdir kcov-source && | |
tar xzf kcov.tar.gz -C kcov-source --strip-components=1 && | |
cd kcov-source && | |
mkdir build && | |
cd build && | |
cmake .. && | |
make -j$(nproc) && | |
sudo make install | |
- name: Install Crystal | |
uses: crystal-lang/install-crystal@v1 | |
with: | |
crystal: ${{ matrix.crystal }} | |
- name: Install Dependencies | |
run: shards install --skip-postinstall --skip-executables | |
env: | |
SHARDS_OVERRIDE: shard.dev.yml | |
- name: Specs | |
run: ./scripts/test.sh all unit | |
shell: bash | |
- uses: codecov/codecov-action@v5 | |
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: coverage | |
files: '**/cov.xml,**/unreachable.codecov.json' | |
flags: unit | |
verbose: true | |
- uses: codecov/test-results-action@v1 | |
if: matrix.os == 'ubuntu-latest' && matrix.crystal == 'nightly' && github.event_name != 'schedule' # Only want to upload coverage report once in the matrix | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
fail_ci_if_error: true | |
directory: coverage | |
files: '**/junit.xml' | |
flags: unit | |
verbose: true |