libsignal-protocol-swift/.github/workflows/main.yml

65 lines
1.8 KiB
YAML

name: CI
on: [pull_request]
jobs:
build_and_test:
name: Build and Test
runs-on: macOS-latest
env:
PKG_CONFIG_PATH: ${{ github.workspace }}/libsignal-ffi/target/debug
steps:
- name: Install nightly rust (needed for libsignal-ffi)
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
profile: minimal
- name: Configure git to use HTTPS
run: git config --global url."https://github.com".insteadOf ssh://git@github.com
- name: Check out libsignal-protocol-swift
uses: actions/checkout@v2
- name: Check out libsignal-ffi
uses: actions/checkout@v2
with:
repository: signalapp/libsignal-ffi
path: libsignal-ffi
- name: Build libsignal-ffi
run: make -C libsignal-ffi
- name: Build libsignal-protocol-swift and run tests
run: swift test -v --enable-code-coverage -Xlinker -rpath -Xlinker $PKG_CONFIG_PATH
- name: Generate coverage report
run: xcrun llvm-cov show --format=html --instr-profile .build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/*.xctest/Contents/MacOS/* Sources --output-dir coverage-report
- name: Upload coverage report
uses: actions/upload-artifact@v2
with:
name: Coverage
path: coverage-report
- name: Summarize coverage
run: xcrun llvm-cov report --instr-profile .build/x86_64-apple-macosx/debug/codecov/default.profdata .build/x86_64-apple-macosx/debug/*.xctest/Contents/MacOS/* Sources
lint:
name: Lint
runs-on: macOS-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: brew install swiftlint
- name: Run lint
run: swiftlint lint --reporter github-actions-logging