From afdd526a61353911ec5c7f87436d484e28cbf800 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ma=C5=A1karinec?= Date: Mon, 19 Feb 2024 17:53:08 +0100 Subject: [PATCH] Update CI scripts MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marek Maškarinec --- .github/actions/build/action.yml | 19 +++++++++++++++++++ .github/workflows/package.yml | 28 ++++------------------------ .github/workflows/test.yml | 13 +++++++++++++ src/staembed.c | 2 +- 4 files changed, 37 insertions(+), 25 deletions(-) create mode 100644 .github/actions/build/action.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml new file mode 100644 index 00000000..a75fd1c8 --- /dev/null +++ b/.github/actions/build/action.yml @@ -0,0 +1,19 @@ +name: Linux Build +runs: + using: "composite" + steps: + - name: Install packages + shell: bash + run: sudo apt install -y openssh-client mesa-common-dev xorg-dev libxi-dev libxcursor-dev mingw-w64 + - name: Update submodules + shell: bash + run: | + git submodule init + git submodule update --remote + - name: Build linux x86_64 + shell: bash + run: make + - name: Build windows x86_64 (cross) + shell: bash + run: make cross + diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 6f02085d..9c0c15ce 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -1,36 +1,16 @@ -name: Tophat workflow +name: Deploy workflow on: [push] jobs: - windows_build: - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - uses: ilammy/msvc-dev-cmd@v1 - - name: Build with CMake+MSbuild - run: | - git submodule init - git submodule update --remote - ./msbuild.bat - - linux_build: + deploy: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v2 - - name: Install packages - run: sudo apt install -y openssh-client mesa-common-dev xorg-dev libxi-dev libxcursor-dev mingw-w64 + - uses: actions/checkout@v3 + - uses: ./.github/actions/build - name: Install SSH key uses: shimataro/ssh-key-action@v2 with: key: ${{ secrets.SSH_KEY }} known_hosts: ${{ secrets.KNOWN_HOSTS }} - - name: Update submodules - run: | - git submodule init - git submodule update --remote - - name: Build linux - run: make - - name: Build windows - run: make cross - name: Deploy run: | rsync tophat marek@tophat2d.dev:www/tophat-web/dl/tophat-linux diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 00000000..a7fc5b23 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,13 @@ +name: Test workflow +on: + push: + pull_request: + branches: + - main +jobs: + deploy: + runs-on: ubuntu-20.04 + steps: + - uses: actions/checkout@v3 + - uses: ./.github/actions/build + - run: tophat -check diff --git a/src/staembed.c b/src/staembed.c index 83554a2b..07a3f276 100644 --- a/src/staembed.c +++ b/src/staembed.c @@ -1,4 +1,4 @@ -#include "tophat.h" +#include "tophat.h" const char *th_em_modulesrc[] = { "\n" "import (\n"