Skip to content

Test Linux Binaries after they're built in CI (Cont'd) #590

Test Linux Binaries after they're built in CI (Cont'd)

Test Linux Binaries after they're built in CI (Cont'd) #590

Workflow file for this run

name: ci
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.2
- name: Install dependencies
run: shards install
- name: Install coverage.py
run: "pip install --upgrade pip && pip install coverage && pip install pytest"
- name: Run tests
run: crystal spec --verbose --order random --error-on-warnings
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.2
- name: Install dependencies
run: shards install
- name: Run linter
run: bin/ameba
coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Crystal
uses: crystal-lang/install-crystal@v1
with:
crystal: 1.13.2
- run: make build
- name: Install kcov
run: |
sudo apt-get update
sudo apt-get install kcov
- name: Install coverage.py
run: "pip install --upgrade pip && pip install coverage && pip install pytest"
- name: Generate coverage
run: bin/crkcov --kcov-args --exclude-pattern=/usr/include,/usr/lib,lib/,spec/ --coverage-dir ${{ github.workspace }}/coverage
- name: Report coverage
env:
COVERALLS_REPO_TOKEN: ${{ github.token }}
run: |
cd coverage
../bin/coveralls report --measure --base-path src/coverage_reporter/
- name: Upload coverage report
uses: actions/upload-artifact@v4
with:
name: coverage-report
path: coverage/
- name: List uploaded artifacts
run: ls -la coverage/
- name: Debug uploaded artifact
run: |
echo "Artifact URL: https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts/"
- name: Display Workflow ID
run: |
curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/actions/workflows" \
| jq '.workflows[] | select(.name == "ci") | .id'