Skip to content

Slightly improve test logging, since our xcode->junit conversion is c… #1110

Slightly improve test logging, since our xcode->junit conversion is c…

Slightly improve test logging, since our xcode->junit conversion is c… #1110

Workflow file for this run

name: CI
on:
push:
branches:
- master
pull_request:
jobs:
build:
name: Build and Test
runs-on: macos-14
permissions:
contents: read
checks: write
pull-requests: write
env:
IS_CI: 1
steps:
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 15.4
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Prepare environment
run: ./scripts/github-ci-pre.sh
- name: Generate and lint docs
run: ./scripts/github-ci-docs.sh
- name: Upload artifacts (docstrings lint annotations)
if: always()
uses: actions/upload-artifact@v4
with:
name: annotations.json
path: build/annotations.json
- name: Build for testing
run: ./scripts/github-ci-testbuild.sh
- name: Upload artifacts
if: always()
uses: actions/upload-artifact@v4
with:
name: build.log
path: artifacts/build.log
- name: Run tests
id: test
run: ./scripts/github-ci-test.sh
- name: Report test results
uses: EnricoMi/publish-unit-test-result-action/macos@v2
if: always()
with:
files: ./build/reports/junit.xml
- name: Upload test coverage
uses: codecov/codecov-action@v4
with:
verbose: false
token: ${{ secrets.CODECOV_TOKEN }}
files: ./build/reports/junit.xml
if: always()
- name: Upload artifacts (test log)
if: always()
uses: actions/upload-artifact@v4
with:
name: test.log
path: artifacts/test.log
- name: Upload artifacts (test results)
if: always()
uses: actions/upload-artifact@v4
with:
name: test_results
path: build/reports/junit.xml
- name: Send notification (Push)
if: ${{ always() && github.event_name == 'push' && github.repository == 'hammerspoon/hammerspoon' }}
run: |
/usr/bin/curl -H "X-CI-WebHook: true" -H "Content-Type: application/json" -d '{"secret": "${{ secrets.CI_WEBHOOK_SECRET }}", "repository": "hammerspoon", "workflow": "CI (Push)", "message": "CI for ${{ github.event.compare }} (${{ github.event.head_commit.author.name }}):\n * ${{ toJSON(github.event.head_commit.message)}}\n * ${{ steps.test.outputs.test_result }}"}' "${{ secrets.CI_WEBHOOK_URL }}"
- name: Send notification (PR)
if: ${{ always() && github.event_name == 'pull_request' && github.repository == 'hammerspoon/hammerspoon' && env.CI_WEBHOOK_URL != '' }}
env:
CI_WEBHOOK_URL: ${{ secrets.CI_WEBHOOK_URL }}
run: |
/usr/bin/curl -H "X-CI-WebHook: true" -H "Content-Type: application/json" -d '{"secret": "${{ secrets.CI_WEBHOOK_SECRET }}", "repository": "hammerspoon", "workflow": "CI (PR)", "message": "CI for ${{ github.event.pull_request.html_url }} (${{ github.actor }})\n * ${{ github.event.pull_request.title }}\n * ${{ steps.test.outputs.test_result }}"}' "${{ secrets.CI_WEBHOOK_URL }}"