Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.

Commit

Permalink
Merge pull request #335 from AriaXLi/pa-4562_gh_actions
Browse files Browse the repository at this point in the history
(PA-4562) Switch from travis to github actions for leatherman
  • Loading branch information
AriaXLi authored Sep 19, 2022
2 parents 2703f11 + 030ee8c commit d9d2b1f
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 40 deletions.
33 changes: 33 additions & 0 deletions .github/actions/docker_pull_and_make/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: docker_pull_and_make

inputs:
pkg_suffix:
description: leatherman package suffix
type: string
cmake_extra_vars:
description: extra vars for cmake
type: string
make_command:
description: make command
type: string
coveralls:
description: on or off
type: string

runs:
using: "composite"
steps:
- name: pull docker image
shell: bash
run: docker pull gcr.io/cpp-projects/cpp-ci:1
- name: run make
shell: bash
run: |
docker run -v `pwd`:/leatherman gcr.io/cpp-projects/cpp-ci:1 /bin/bash -c "
cd /leatherman &&
rm locales/leatherman.pot &&
cmake ${{ matrix.options.cmake_extra_vars }} . &&
mkdir dest &&
make ${{ matrix.options.make_command }} DESTDIR=/leatherman/dest -j2 &&
{ [[ '${{ matrix.options.coveralls }}' == 'ON' ]] && coveralls --gcov-options '\-lp' -r . -b . -e src -e vendor >/dev/null || true; }
"
35 changes: 35 additions & 0 deletions .github/workflows/ci_checks.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: CI Checks

on:
push:
branches: [main]
pull_request:
branches: [main]

permissions:
contents: read

jobs:
ci_checks:
strategy:
matrix:
options:
- make_command: cpplint
- make_command: cppcheck
- make_command: all test install ARGS=-v
cmake_extra_vars: -DCMAKE_BUILD_TYPE=Debug -DCOVERALLS=ON
coveralls: ON
- make_command: all test install ARGS=-v
cmake_extra_vars: -DLEATHERMAN_USE_LOCALES=OFF
- make_command: all test install ARGS=-v
cmake_extra_vars: -DLEATHERMAN_GETTEXT=OFF
runs-on: ubuntu-latest
steps:
- name: checkout current pr
uses: actions/checkout@v3
- name: docker pull and make
uses: ./.github/actions/docker_pull_and_make
with:
cmake_extra_vars: ${{ matrix.options.cmake_extra_vars }}
make_command: ${{ matrix.options.make_command }}
coveralls: ${{ matrix.options.coveralls }}
38 changes: 38 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Jobs

on:
push:
tags:
- '*'

permissions:
contents: write

jobs:
release:
strategy:
matrix:
options:
- make_command: all test install ARGS=-v
cmake_extra_vars: -DBOOST_STATIC=ON
- make_command: all test install ARGS=-v
cmake_extra_vars: -DLEATHERMAN_SHARED=ON
pkg_suffix: "-dynamic"
runs-on: ubuntu-latest
steps:
- name: checkout current pr
uses: actions/checkout@v3
- name: docker pull and make
uses: ./.github/actions/docker_pull_and_make
with:
cmake_extra_vars: ${{ matrix.options.cmake_extra_vars }}
make_command: ${{ matrix.options.make_command }}
pkg_suffix: ${{ matrix.options.pkg_suffix }}
- name: build release artifact for tags
if: startsWith(github.ref, 'refs/tags/')
run: tar czvf leatherman${{ matrix.options.pkg_suffix }}.tar.gz `find dest -type f -print`
- name: upload release artifacts for tag
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: leatherman${{ matrix.options.pkg_suffix }}.tar.gz
40 changes: 0 additions & 40 deletions .travis.yml

This file was deleted.

0 comments on commit d9d2b1f

Please sign in to comment.