CI #3600
This file contains hidden or 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@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - name: Check Spelling | |
| uses: crate-ci/typos@bb4666ad77b539a6b4ce4eda7ebb6de553704021 # v1.42.0 | |
| check_format: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| crystal: | |
| - latest | |
| - nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0 | |
| - name: Install Crystal | |
| uses: crystal-lang/install-crystal@56684e85b94c6340f5035965d57dcfdedd1ab0de # v1.9.1 | |
| with: | |
| crystal: ${{ matrix.crystal }} | |
| - name: Check Format | |
| run: just format | |
| coding_standards: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0 | |
| - name: Install Crystal | |
| uses: crystal-lang/install-crystal@56684e85b94c6340f5035965d57dcfdedd1ab0de # v1.9.1 | |
| - name: Install Dependencies | |
| run: shards install | |
| env: | |
| SHARDS_OVERRIDE: shard.dev.yml | |
| - name: Ameba | |
| run: just ameba | |
| test_compiled: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| crystal: | |
| - latest | |
| - nightly | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0 | |
| - name: Install kcov | |
| if: ${{ matrix.crystal == vars.COVERAGE_CHANNEL }} | |
| 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@56684e85b94c6340f5035965d57dcfdedd1ab0de # v1.9.1 | |
| with: | |
| crystal: ${{ matrix.crystal }} | |
| - name: Install System Dependencies | |
| run: sudo apt-get update && sudo apt install -y libmagic-dev | |
| - name: Install Dependencies | |
| run: shards install --skip-postinstall --skip-executables | |
| env: | |
| SHARDS_OVERRIDE: shard.dev.yml | |
| - name: Compiled Specs | |
| run: just test-compiled | |
| shell: bash | |
| - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| if: ${{ matrix.crystal == vars.COVERAGE_CHANNEL && 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,**/macro_coverage.*.codecov.json' # There is no `unreachable.codecov.json` file when running _only_ compiled specs | |
| verbose: true | |
| - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| if: ${{ matrix.crystal == vars.COVERAGE_CHANNEL && 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' | |
| verbose: true | |
| report_type: test_results | |
| test_unit: | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: | |
| - ubuntu-latest | |
| - ubuntu-24.04-arm | |
| - macos-latest | |
| - windows-latest | |
| crystal: | |
| - latest | |
| - nightly | |
| runs-on: ${{ matrix.os }} | |
| steps: | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| if: github.event_name != 'pull_request' | |
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1 | |
| if: github.event_name == 'pull_request' | |
| with: | |
| fetch-depth: 0 | |
| - uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3.0.0 | |
| - name: Install kcov | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.crystal == vars.COVERAGE_CHANNEL }} | |
| 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@56684e85b94c6340f5035965d57dcfdedd1ab0de # v1.9.1 | |
| with: | |
| crystal: ${{ matrix.crystal }} | |
| - name: Install System Dependencies | |
| if: matrix.os == 'ubuntu-latest' || matrix.os == 'ubuntu-24.04-arm' | |
| run: sudo apt-get update && sudo apt install -y libmagic-dev | |
| - name: Install System Dependencies | |
| if: matrix.os == 'macos-latest' | |
| run: brew install libmagic | |
| - name: Install Dependencies | |
| run: shards install --skip-postinstall --skip-executables | |
| env: | |
| SHARDS_OVERRIDE: shard.dev.yml | |
| - name: Specs | |
| run: just test-unit | |
| shell: bash | |
| - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.crystal == vars.COVERAGE_CHANNEL && 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' | |
| verbose: true | |
| - uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 | |
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.crystal == vars.COVERAGE_CHANNEL && 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' | |
| verbose: true | |
| report_type: test_results |