| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108 |
- name: Tests
- on:
- push:
- paths-ignore:
- - "*.md"
- branches-ignore:
- - 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:
- build-test:
- name: Build and test
- runs-on: buildjet-2vcpu-ubuntu-2204
- strategy:
- matrix:
- nim: ["1.6.x", "2.0.x", "2.2.x", "devel"]
- steps:
- - name: Checkout Code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Cache Nimble Dependencies
- id: cache-nimble
- uses: buildjet/cache@v4
- with:
- path: ~/.nimble
- key: ${{ matrix.nim }}-nimble-v2-${{ hashFiles('*.nimble') }}
- restore-keys: |
- ${{ matrix.nim }}-nimble-v2-
- - name: Setup Nim
- uses: jiro4989/setup-nim-action@v2
- with:
- nim-version: ${{ matrix.nim }}
- use-nightlies: true
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Build Project
- run: nimble build -d:release -Y
- integration-test:
- needs: [build-test]
- name: Integration test
- runs-on: buildjet-2vcpu-ubuntu-2204
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
- - name: Cache Nimble Dependencies
- id: cache-nimble
- uses: buildjet/cache@v4
- with:
- path: ~/.nimble
- key: devel-nimble-v2-${{ hashFiles('*.nimble') }}
- restore-keys: |
- devel-nimble-v2-
- - name: Setup Python (3.10) with pip cache
- uses: buildjet/setup-python@v4
- with:
- python-version: "3.10"
- cache: pip
- - name: Setup Nim
- uses: jiro4989/setup-nim-action@v2
- with:
- nim-version: devel
- use-nightlies: true
- repo-token: ${{ secrets.GITHUB_TOKEN }}
- - name: Build Project
- run: nimble build -d:release -Y
- - name: Install SeleniumBase and Chromedriver
- run: |
- 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
- run: |
- ./nitter &
- pytest -n2 tests
|