87 lines
2.4 KiB
YAML
87 lines
2.4 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
name: Build and Test
|
|
runs-on: macos-11.0
|
|
env:
|
|
IS_CI: 1
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
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@v2
|
|
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@v2
|
|
with:
|
|
name: build.log
|
|
path: artifacts/build.log
|
|
|
|
- name: Run tests
|
|
id: test
|
|
run: ./scripts/github-ci-test.sh
|
|
|
|
- name: Upload test coverage
|
|
uses: codecov/codecov-action@v1
|
|
with:
|
|
verbose: true
|
|
if: always()
|
|
|
|
- name: Upload artifacts (test log)
|
|
if: always()
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: test.log
|
|
path: artifacts/test.log
|
|
- name: Upload artifacts (test results)
|
|
if: always()
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: test_results
|
|
path: build/reports/junit.xml
|
|
|
|
- name: IRC notification - push
|
|
uses: Gottox/irc-message-action@v2.1.0
|
|
if: ${{ always() && github.event_name == 'push' && github.repository == 'hammerspoon/hammerspoon' }}
|
|
with:
|
|
channel: '#hammerspoon'
|
|
nickname: 'HSGHA'
|
|
message: |
|
|
CI for ${{ github.event.compare }} (${{ github.event.head_commit.author.name }}):
|
|
* ${{ github.event.head_commit.message }}
|
|
* ${{ steps.test.outputs.test_result }}
|
|
- name: IRC notification - PR
|
|
uses: Gottox/irc-message-action@v2.1.0
|
|
if: ${{ always() && github.event_name == 'pull_request' && github.repository == 'hammerspoon/hammerspoon' }}
|
|
with:
|
|
channel: '#hammerspoon'
|
|
nickname: 'HSGHA'
|
|
message: |
|
|
CI for ${{ github.event.pull_request.html_url }} (${{ github.actor }}):
|
|
* ${{ github.event.pull_request.title }}
|
|
* ${{ steps.test.outputs.test_result }}
|
|
|