From fbd8e1558ea5874001e00ef2fed78c213a2c4a40 Mon Sep 17 00:00:00 2001 From: Zed Date: Wed, 5 Feb 2025 21:48:29 +0100 Subject: [PATCH] Build test --- .github/workflows/run-tests.yml | 58 +++++++++++++++++++++++---------- 1 file changed, 40 insertions(+), 18 deletions(-) diff --git a/.github/workflows/run-tests.yml b/.github/workflows/run-tests.yml index da925255..40afff33 100644 --- a/.github/workflows/run-tests.yml +++ b/.github/workflows/run-tests.yml @@ -8,21 +8,29 @@ on: - master workflow_call: +# Ensure that multiple runs on the same branch do not overlap. +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash + jobs: - test: + integration-test: + name: Full integration test runs-on: buildjet-2vcpu-ubuntu-2204 strategy: matrix: - nim: - - "1.6.x" - - "2.0.x" - - "2.2.x" - - "devel" + nim: ["devel"] steps: - - uses: actions/checkout@v3 + - name: Checkout code + uses: actions/checkout@v3 with: fetch-depth: 0 - - name: Cache nimble + + - name: Cache Nimble Dependencies id: cache-nimble uses: buildjet/cache@v3 with: @@ -30,27 +38,41 @@ jobs: key: ${{ matrix.nim }}-nimble-${{ hashFiles('*.nimble') }} restore-keys: | ${{ matrix.nim }}-nimble- - - uses: actions/setup-python@v4 + + - name: Setup Python (3.10) with pip cache + uses: actions/setup-python@v4 with: python-version: "3.10" - cache: "pip" - - uses: jiro4989/setup-nim-action@v1 + cache: pip + + - name: Setup Nim + uses: jiro4989/setup-nim-action@v1 with: nim-version: ${{ matrix.nim }} repo-token: ${{ secrets.GITHUB_TOKEN }} - - run: nimble build -d:release -Y - - run: pip install seleniumbase - - run: seleniumbase install chromedriver - - uses: supercharge/redis-github-action@1.5.0 - - name: Prepare Nitter + + - name: Build Project + run: nimble build -d:release -Y + + - name: Install SeleniumBase and Chromedriver run: | - sudo apt install libsass-dev -y + pip install seleniumbase + seleniumbase install chromedriver + + - name: Start Redis Service + uses: supercharge/redis-github-action@1.5.0 + + - name: Prepare Nitter Environment + run: | + sudo apt-get update && sudo apt-get install -y libsass-dev cp nitter.example.conf nitter.conf sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf nimble md nimble scss + echo '${{ secrets.SESSIONS }}' | head -n1 echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl - - name: Run tests + + - name: Run Tests run: | ./nitter & pytest -n3 tests