Skip to content

Commit

Permalink
add workflows file
Browse files Browse the repository at this point in the history
  • Loading branch information
Xiao YaoBing committed Oct 31, 2023
1 parent f89ce00 commit 491f98e
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/archlinux-build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Build on archlinux

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release

jobs:
container:
runs-on: ubuntu-latest
container: archlinux:latest
steps:
- name: Run in container
run: |
sed -i /etc/pacman.d/mirrorlist -e "1iServer = https://mirrors.tuna.tsinghua.edu.cn/archlinux/\$repo/os/\$arch"
cat /etc/pacman.d/mirrorlist
pacman-key --init
pacman --noconfirm --noprogressbar -Syu
- name: Install dep
run: |
pacman -Syu --noconfirm cmake pkgconfig git extra-cmake-modules qt6-base qt6-declarative
pacman -Syu --noconfirm clang ninja zstd doxygen sdl2 mesa assimp
pacman -Syu --noconfirm fakeroot sudo
- name: Set up user
run: |
useradd -m githubuser
echo -e "root ALL=(ALL:ALL) ALL\ngithubuser ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers
- name: Install KTX-Software from the github
run: |
su githubuser -c "cd ~ && git clone [email protected]:KhronosGroup/KTX-Software.git && cd ./KTX-Software && makedir build && cd ./build &&
cmake -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -D KTX_FEATURE_LOADTEST_APPS=ON -D KTX_FEATURE_DOC=ON -DKTX_FEATURE_TOOLS=OFF .."
# - uses: actions/checkout@v3
# with:
# submodules: true

# - name: Configure CMake
# run: |
# mkdir -p ${{github.workspace}}/build
# cmake -B ${{github.workspace}}/build -G Ninja -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
# - name: Build
# # Build your program with the given configuration
# run: cmake --build ${{github.workspace}}/build
18 changes: 18 additions & 0 deletions .github/workflows/cppcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: CppCheck for C++ Project

on: [push, pull_request]

jobs:
cppcheck:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Install cppcheck
run: sudo apt-get update && sudo apt-get install -y cppcheck

- name: Run Cppcheck
if: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
run: cppcheck --language=c++ .

0 comments on commit 491f98e

Please sign in to comment.