From 02a23cd4159120296b2937845353fbe96298c415 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C3=ADas=20Israelson?= <57065102+israpps@users.noreply.github.com> Date: Sat, 11 Nov 2023 20:42:10 -0300 Subject: [PATCH] add continous integration --- .github/workflows/compile.yml | 60 +++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/compile.yml diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml new file mode 100644 index 0000000..733ba19 --- /dev/null +++ b/.github/workflows/compile.yml @@ -0,0 +1,60 @@ +name: CI + +on: + push: + paths: + - 'engine/**' + - 'demo/**' + - '**.cpp' + - '.github/workflows/compile.yml' + workflow_dispatch: + inputs: + make_args: + description: pass extra make argumments to Program compilation + repository_dispatch: + types: [run_build] + +jobs: + build: + runs-on: ubuntu-latest + container: h4570/tyra + steps: + - name: install deps + run: | + apt-get update + apt install -y git make wget + + - name: Workaround permission issue + run: | + git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Checkout + uses: actions/checkout@v3 + + - name: Compile tyra + run: | + make clean all ${{ github.event.inputs.make_args }} -C engine + + - name: Compile tyra demo + run: | + make clean all -C demo + + - name: Get short SHA + id: slug + run: | + echo "SHA8=$(echo ${GITHUB_SHA} | cut -c1-8)" >> $GITHUB_ENV + + - name: Get branch + if: github.ref != 'refs/heads/main' + id: brnch + run: | + echo "BRANCH=$(echo -${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + + - name: Upload artifacts + if: ${{ success() }} + uses: actions/upload-artifact@v3 + with: + name: tyra-${{ env.SHA8 }}${{ env.BRANCH }} + path: | + engine/bin + demo/bin