Use reusable action for check

This commit is contained in:
Linus Dierheimer
2022-03-24 21:57:53 +01:00
parent ef5a9384da
commit 83e2787b24
4 changed files with 46 additions and 47 deletions
+44
View File
@@ -0,0 +1,44 @@
name: build and check fastfetch
description: builds and checks fastfetch
runs:
using: composite
steps:
- name: install required packages
shell: sh
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libxfconf-0-dev librpm-dev libzstd-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: configure project
shell: sh
# We reuse the build binary only for the releases.
# We set tweak version to off, because it is wrong, as git tag will happen after this step. Releases don't have a tweak, so this is ok.
run: cmake -DSET_TWEAK=Off .
- name: build project
shell: sh
run: cmake --build . -j$(nproc)
- name: run fastfetch
shell: sh
run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true
- name: run flashfetch
shell: sh
run: ./flashfetch
- name: run tests
shell: sh
run: ctest
- name: build deb package
shell: sh
run: sh packaging/deb/create.sh .
- name: perform CodeQL analysis
shell: sh
uses: github/codeql-action/analyze@v1
-45
View File
@@ -1,45 +0,0 @@
name: run build and checks
on: workflow_call
jobs:
check:
name: run build and checks
runs-on: ubuntu-latest
permissions:
security-events: write
strategy:
fail-fast: false
matrix:
language: [ 'cpp' ]
steps:
- name: install required packages
run: sudo apt-get update && sudo apt-get install -y libpci-dev libvulkan-dev libwayland-dev libxrandr-dev libxcb-randr0-dev libdconf-dev libdbus-1-dev libxfconf-0-dev librpm-dev libzstd-dev
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
- name: configure project
# We reuse the build binary only for the releases.
# We set tweak version to off, because it is wrong, as git tag will happen after this step. Releases don't have a tweak, so this is ok.
run: cmake -DSET_TWEAK=Off .
- name: build project
run: cmake --build . -j$(nproc)
- name: run fastfetch
run: ./fastfetch --recache --disable-linewrap false --hide-cursor false --show-errors true
- name: run flashfetch
run: ./flashfetch
- name: run tests
run: ctest
- name: build deb package
run: sh packaging/deb/create.sh .
- name: perform CodeQL analysis
uses: github/codeql-action/analyze@v1
+1 -1
View File
@@ -11,4 +11,4 @@ jobs:
uses: actions/checkout@v2
- name: run build and check
uses: LinusDierheimer/fastfetch/.github/workflows/check.yml@master
uses: ./.github/actions/check
+1 -1
View File
@@ -15,7 +15,7 @@ jobs:
uses: actions/checkout@v2
- name: run build and check
uses: LinusDierheimer/fastfetch/.github/workflows/check.yml@master
uses: ./.github/actions/check
- name: get fastfetch version
id: get_version_fastfetch