2023-04-21 15:41:48 +00:00
|
|
|
name: Tests
|
2023-03-28 15:36:48 +00:00
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- "*.md"
|
2023-04-21 21:43:46 +00:00
|
|
|
branches-ignore:
|
|
|
|
- master
|
|
|
|
workflow_call:
|
2023-03-28 15:36:48 +00:00
|
|
|
|
2025-02-05 20:48:29 +00:00
|
|
|
# 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
|
|
|
|
|
2023-03-28 15:36:48 +00:00
|
|
|
jobs:
|
2025-02-05 20:48:29 +00:00
|
|
|
build-test:
|
|
|
|
name: Build and test
|
2023-11-01 05:09:21 +00:00
|
|
|
runs-on: buildjet-2vcpu-ubuntu-2204
|
2023-10-31 23:46:24 +00:00
|
|
|
strategy:
|
|
|
|
matrix:
|
2025-02-05 20:48:29 +00:00
|
|
|
nim: ["1.6.x", "2.0.x", "2.2.x", "devel"]
|
2023-03-28 15:36:48 +00:00
|
|
|
steps:
|
2025-02-05 20:48:29 +00:00
|
|
|
- name: Checkout Code
|
|
|
|
uses: actions/checkout@v4
|
2023-03-28 15:36:48 +00:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2025-02-05 20:48:29 +00:00
|
|
|
|
|
|
|
- name: Cache Nimble Dependencies
|
2023-03-28 15:36:48 +00:00
|
|
|
id: cache-nimble
|
2025-02-05 20:48:29 +00:00
|
|
|
uses: buildjet/cache@v4
|
2023-03-28 15:36:48 +00:00
|
|
|
with:
|
|
|
|
path: ~/.nimble
|
2025-02-05 20:48:29 +00:00
|
|
|
key: ${{ matrix.nim }}-nimble-v2-${{ hashFiles('*.nimble') }}
|
2023-11-01 05:09:21 +00:00
|
|
|
restore-keys: |
|
2025-02-05 20:48:29 +00:00
|
|
|
${{ 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
|
2023-03-28 15:36:48 +00:00
|
|
|
with:
|
|
|
|
python-version: "3.10"
|
2025-02-05 20:48:29 +00:00
|
|
|
cache: pip
|
|
|
|
|
|
|
|
- name: Setup Nim
|
|
|
|
uses: jiro4989/setup-nim-action@v2
|
2023-03-28 15:36:48 +00:00
|
|
|
with:
|
2025-02-05 20:48:29 +00:00
|
|
|
nim-version: devel
|
|
|
|
use-nightlies: true
|
2023-10-31 23:46:24 +00:00
|
|
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
2025-02-05 20:48:29 +00:00
|
|
|
|
|
|
|
- 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
|
2023-03-28 15:36:48 +00:00
|
|
|
run: |
|
2025-02-05 20:48:29 +00:00
|
|
|
sudo apt-get update && sudo apt-get install -y libsass-dev
|
2023-03-28 15:36:48 +00:00
|
|
|
cp nitter.example.conf nitter.conf
|
2023-11-01 04:06:42 +00:00
|
|
|
sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
|
2023-03-28 15:36:48 +00:00
|
|
|
nimble md
|
|
|
|
nimble scss
|
2025-02-05 20:48:29 +00:00
|
|
|
echo '${{ secrets.SESSIONS }}' | head -n1
|
2025-02-05 03:24:35 +00:00
|
|
|
echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl
|
2025-02-05 20:48:29 +00:00
|
|
|
|
|
|
|
- name: Run Tests
|
2023-03-28 15:36:48 +00:00
|
|
|
run: |
|
|
|
|
./nitter &
|
2025-02-12 20:22:09 +00:00
|
|
|
pytest -n1 tests
|