From 5b68cd3cb098950c8f0c85eb672bc39fa4268156 Mon Sep 17 00:00:00 2001 From: mrognor Date: Fri, 10 Jan 2025 19:39:37 +0300 Subject: [PATCH] Improve ci pipeline --- .github/{workflows => }/static.yml | 0 .github/workflows/tests.yml | 54 ++++++++++++++++++++++++++++++ 2 files changed, 54 insertions(+) rename .github/{workflows => }/static.yml (100%) create mode 100644 .github/workflows/tests.yml diff --git a/.github/workflows/static.yml b/.github/static.yml similarity index 100% rename from .github/workflows/static.yml rename to .github/static.yml diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml new file mode 100644 index 0000000..983dde0 --- /dev/null +++ b/.github/workflows/tests.yml @@ -0,0 +1,54 @@ +# Simple workflow for run tests on GitHub Actions +name: Run tests + +on: + # Runs on pushes targeting the default branch + push: + branches: ["master"] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +jobs: + # Run project tests + tests: + name: Build and run tests + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install packages + run: sudo apt-get update && sudo apt-get upgrade && sudo apt-get -y install cmake lcov + + - name: Build and run tests + run: ./Scripts/RunTests + + # Upload artifacts to reuse it in next jobs + - uses: actions/upload-artifact@v4 + with: + name: TestArtifacts + path: ./Build + + telegram: + name: Send report to telegram + needs: tests + runs-on: ubuntu-24.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - uses: actions/download-artifact@v4 + with: + name: BuildArtifacts + + - name: Install packages + run: sudo apt-get update && sudo apt-get upgrade && sudo apt-get -y install python3 pipx + + - name: Send report to telegram + run: ./.github/TelegramReport/SendCiReportToTelegram.sh ${{ secrets.BOT_ID }} ${{ secrets.CHAT_ID }} ${{ secrets.TOPIC_ID }} \ No newline at end of file