1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00
qTox/.github/workflows/test.yaml
Anthony Bilinski 4699e84e14
chore(ci): Migrate PR CI from travis-ci.org and circleci to GitHub Actions
Partially fix #6345, only PR portion, not nightly or releases.

Unlike travis, we're not caching our brew packages. `actions/cache` doesn't
update the cache on cache hit, making it hard to use a rolling cache like
before. We also don't know what cache key we should use before running, since
it relies on the live package list of brew.

Using a docker image containing brew packages seems like a better option if we
need the speedup going forward. ATM a full build with deps only takes about 12
minutes. Windows builds don't have this issue, since deps there are keyed off of
known versions in our repo.

Current Windows matrix form works, but causes a double-build on dep change due
to both debug/release rebuilding the release deps. Instead, should probably
separate the dep jobs, block build on the dep jobs, and update the cache on dep
jobs, guaranteeing a cache hit on build jobs?

Windows stage 1 and stage 2 can probably be recombined, if they were split due
to travis single build length limits, since GH actions allows much longer single
builds.
2021-06-27 01:03:23 -07:00

119 lines
3.3 KiB
YAML

name: test
on: pull_request
jobs:
verify-commit-format:
name: Verify Commit Format
runs-on: ubuntu-18.04
env:
GITHUB_CONTEXT: ${{ github.event.pull_request.commits_url }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0 # so that we can see the full commit range
- name: Run
run: ./.travis/verify-commit-format.sh
build-docs:
name: Docs
runs-on: ubuntu-18.04
env:
DOXYGEN_CONFIG_FILE: doxygen.conf
steps:
- uses: actions/checkout@v2
- name: Run
run: ./.travis/build-docs.sh
build-gitstats:
name: Gitstats
runs-on: ubuntu-18.04
env:
GITSTATS_DIR: gitstats
steps:
- uses: actions/checkout@v2
- name: Install gitstats
run: sudo apt-get install gitstats
- name: Run
run: ./.travis/build-gitstats.sh
build-qtox:
name: Linux
runs-on: ubuntu-18.04
env:
CC: gcc
CXX: g++
steps:
- uses: actions/checkout@v2
- name: Install deps
run: sudo apt-get install ccache lcov
- name: Run
run: ./.travis/build-ubuntu-16-04.sh
- name: Code test coverage
run: |
# Create lcov report
lcov --directory _build --capture --output-file coverage.info
# Filter out system headers and test sources
lcov --remove coverage.info '/usr/*' '*/test/*' '*/*_autogen/*' --output-file coverage.info
# Upload report to codecov.io
bash <(curl -s https://codecov.io/bash) -f coverage.info || echo "Codecov did not collect coverage reports"
build-osx:
name: macOS
runs-on: macos-10.15
env:
TRAVIS: true
TRAVIS_BUILD_DIR: ${{ github.workspace }}
steps:
- uses: actions/checkout@v2
- name: homebrew
run: brew upgrade && brew bundle --file ./osx/Brewfile
- name: Run
run: ./.travis/build-osx.sh
APPIMAGE:
name: AppImage
runs-on: ubuntu-18.04
env:
TRAVIS_TAG:
TRAVIS_COMMIT: ${{ github.sha }}
steps:
- uses: actions/checkout@v2
- name: Run
run: ./appimage/build-appimage.sh
FLATPAK:
name: Flatpak
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v2
- name: Run
run: ./flatpak/build-flatpak.sh
win:
name: Windows
runs-on: ubuntu-latest
strategy:
matrix:
arch: [i686, x86_64]
type: [debug, release]
env:
BUILD__: ${{ matrix.arch }}
BTYPE__: ${{ matrix.type }}
steps:
- uses: actions/checkout@v2
- name: Cache dependencies
uses: actions/cache@v2
with:
path: cache
key: deps-${{ matrix.arch }}-${{ hashFiles('windows/cross-compile/build.sh') }}-${{ hashFiles('.travis/build-windows.sh') }}
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install zip tree
- name: Deps build stage 1
run: |
./.travis/build-windows.sh "$BUILD__" "release" "cache/${BUILD__}" stage1
- name: Deps build stage 2
run: |
./.travis/build-windows.sh "$BUILD__" "release" "cache/${BUILD__}" stage2
ls -al cache
- name: qTox build
run: |
./.travis/build-windows.sh "$BUILD__" "$BTYPE__" "cache/${BUILD__}" stage3
- name: Debug info
run: |
ls -al ~/
tree ~/project/workspace -L 4