Skip to content

Commit

Permalink
ci: update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
masnagam committed May 26, 2023
1 parent e1fca18 commit 46a887d
Show file tree
Hide file tree
Showing 14 changed files with 61 additions and 400 deletions.
6 changes: 1 addition & 5 deletions .github/workflows/auto-merge.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# See https://github.com/dependabot/dependabot-core/issues/2268#issuecomment-831376155
name: Auto Merge
name: auto-merge

on:
workflow_run:
Expand All @@ -21,8 +21,6 @@ jobs:
steps:
- uses: actions/github-script@v6
with:
# Use PAT in order to invoke other workflows.
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
const pull_number = context.payload.workflow_run.pull_requests[0].number;
Expand Down Expand Up @@ -51,8 +49,6 @@ jobs:
steps:
- uses: actions/github-script@v6
with:
# Use PAT in order to invoke other workflows.
github-token: ${{ secrets.BOT_GITHUB_TOKEN }}
script: |
const { owner, repo } = context.repo;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: build

on:
workflow_call:

jobs:
linux-build:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -9,9 +14,9 @@ jobs:
uses: actions/cache@v3
with:
path: build/vendor
key: ${{ runner.os }}-linux-build-${{ hashFiles('CMakeLists.txt') }}
key: ${{ runner.os }}-build-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-linux-build-
${{ runner.os }}-build-
- name: Install deps
run: |
sudo apt-get update
Expand Down
172 changes: 17 additions & 155 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,164 +1,26 @@
# DO NOT EDIT THIS FILE BY HAND.
#
# This file was generated by .github/workflows/update.sh automagically.
name: CI
name: ci

on:
push:
branches:
- main
- release
- trial-*
paths-ignore:
- '**.md'

jobs:
linux-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache for external projects
uses: actions/cache@v3
with:
path: build/vendor
key: ${{ runner.os }}-linux-build-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-linux-build-
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends autoconf automake cmake dos2unix g++ libtool make ninja-build pkg-config
- name: Generate project files
run: |
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D MIRAKC_ARIB_TEST=ON
- name: Build vendor libraries
run: |
ninja -C build vendor
- name: Build
run: |
ninja -C build
- name: Show help and version
run: |
build/bin/mirakc-arib -h
build/bin/mirakc-arib --version
- name: Run test
run: |
ninja -C build test
ninja -C build cli-tests
#macos-build:
arm-linux-build:
strategy:
matrix:
arch:
# Disabled because there is no linux/arm/v5 image of ubuntu.
# - armel
- armhf
- arm64
include:
# - arch: armel
# host-triple: arm-linux-gnueabi
# elf-machine: 'ARM'
# elf-flags: 'soft-float'
# docker-platform: linux/arm/v5
- arch: armhf
host-triple: arm-linux-gnueabihf
elf-machine: 'ARM'
elf-flags: 'hard-float'
docker-platform: linux/arm/v7
- arch: arm64
host-triple: aarch64-linux-gnu
elf-machine: 'AArch64'
elf-flags: ''
docker-platform: linux/arm64/v8
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache for external projects
uses: actions/cache@v3
with:
path: build/vendor
key: ${{ runner.os }}-arm-build-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-arm-build-${{ matrix.arch }}-
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends autoconf automake cmake dos2unix g++-${{ matrix.host-triple }} libtool make ninja-build pkg-config
- name: Generate project files
run: |
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release -D MIRAKC_ARIB_TEST=ON -D CMAKE_TOOLCHAIN_FILE=toolchain.cmake.d/debian-${{ matrix.arch }}.cmake .
- name: Build vendor libraries
run: |
ninja -C build vendor
- name: Build
run: |
ninja -C build
- name: Check the binary format
run: |
readelf -h build/bin/mirakc-arib | grep Machine | grep '${{ matrix.elf-machine }}'
readelf -h build/bin/mirakc-arib | grep Flags | grep '${{ matrix.elf-flags }}'
- name: Setup QEMU user-mode emulation
uses: docker/setup-qemu-action@v2
- name: Show help and version
run: |
sudo apt-get install -y --no-install-recommends lsb-release
docker run --rm -v $(pwd)/build:/build --platform ${{ matrix.docker-platform }} ubuntu:$(lsb_release -cs) /build/bin/mirakc-arib -h
docker run --rm -v $(pwd)/build:/build --platform ${{ matrix.docker-platform }} ubuntu:$(lsb_release -cs) /build/bin/mirakc-arib --version
- name: Run tests
run: |
docker run --rm -e CI=$CI -v $(pwd)/build:/build --platform ${{ matrix.docker-platform }} ubuntu:$(lsb_release -cs) /build/bin/mirakc-arib-test --gtest_shuffle
docker run --rm -e CI=$CI -v $(pwd)/build:/build -v $(pwd)/test:/test --platform ${{ matrix.docker-platform }} ubuntu:$(lsb_release -cs) sh /test/cli_tests.sh /build/bin/mirakc-arib
build:
uses: ./.github/workflows/build.yml
secrets: inherit
cross-build:
uses: ./.github/workflows/cross-build.yml
secrets: inherit
# macos-build:
# uses: ./.github/workflows/macos-build.yml
# secrets: inherit
coverage:
needs:
- linux-build
runs-on: ubuntu-latest
continue-on-error: true
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: Cache for external projects
uses: actions/cache@v3
with:
path: build/vendor
key: ${{ runner.os }}-coverage-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-coverage-
- name: Cache for grcov
uses: actions/cache@v3
with:
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-grcov
- name: Install deps
run: |
sudo apt-get update
sudo apt-get install -y --no-install-recommends autoconf automake cmake dos2unix g++ libtool make ninja-build pkg-config
- name: Generate project files
run: |
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Debug -D MIRAKC_ARIB_TEST=ON -D MIRAKC_ARIB_COVERAGE=ON
- name: Build vendor libraries
run: |
ninja -C build vendor
- name: Build
run: |
ninja -C build
- name: Run test
run: |
ninja -C build test
ninja -C build cli-tests
- name: Install cargo-binstall
run: |
BINSTALL_URL=https://github.com/cargo-bins/cargo-binstall/releases/latest/download/cargo-binstall-x86_64-unknown-linux-musl.tgz
curl -fsSL $BINSTALL_URL | tar -xz -C ~/.cargo/bin --no-same-owner
- name: Install grcov
run: |
cargo binstall --no-confirm grcov
- name: Generate coverage data
run: >-
grcov build --branch --llvm --ignore-not-existing -s . -p .. --ignore 'test/*' -t lcov -o lcov.info
- name: Update to codecov.io
uses: codecov/codecov-action@v3
with:
files: lcov.info
- build
uses: ./.github/workflows/coverage.yml
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/clang-format-check.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: clang-format Check
name: clang-format-check
on: [push, pull_request]
jobs:
formatting-check:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
name: coverage

on:
workflow_call:

jobs:
coverage:
runs-on: ubuntu-latest
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
name: cross-build

on:
workflow_call:

jobs:
arm-linux-build:
cross-build:
strategy:
matrix:
arch:
Expand Down Expand Up @@ -32,9 +37,9 @@ jobs:
uses: actions/cache@v3
with:
path: build/vendor
key: ${{ runner.os }}-arm-build-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt') }}
key: ${{ runner.os }}-cross-build-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt') }}
restore-keys: |
${{ runner.os }}-arm-build-${{ matrix.arch }}-
${{ runner.os }}-cross-build-${{ matrix.arch }}-
- name: Install deps
run: |
sudo apt-get update
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/daily.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Daily
name: daily

on:
schedule:
Expand All @@ -17,8 +17,6 @@ jobs:
# Fetch all history for all branches and tags
# so that ./scripts/update-deps works properly.
fetch-depth: 0
# Use PAT in order to invoke other workflows.
token: ${{ secrets.BOT_GITHUB_TOKEN }}
- name: git config
run: |
# https://github.com/actions/checkout#push-a-commit-using-the-built-in-token
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
name: macos-build

on:
workflow_call:

jobs:
macos-build:
runs-on: macos-latest
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mega-linter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter
name: mega-linter

on:
# Trigger mega-linter at every push. Action will also be visible from Pull Requests to master
Expand Down
Loading

0 comments on commit 46a887d

Please sign in to comment.