Skip to content

Commit 2b2c61c

Browse files
committed
Build test
1 parent 54ba1e3 commit 2b2c61c

File tree

1 file changed

+77
-20
lines changed

1 file changed

+77
-20
lines changed

.github/workflows/run-tests.yml

+77-20
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,106 @@ on:
88
- master
99
workflow_call:
1010

11+
# Ensure that multiple runs on the same branch do not overlap.
12+
concurrency:
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
15+
16+
defaults:
17+
run:
18+
shell: bash
19+
1120
jobs:
12-
test:
21+
build-test:
22+
name: Build and Test
1323
runs-on: buildjet-2vcpu-ubuntu-2204
1424
strategy:
1525
matrix:
16-
nim:
17-
- "1.6.x"
18-
- "2.0.x"
19-
- "2.2.x"
20-
- "devel"
26+
nim: ["1.6.x", "2.0.x", "2.2.x", "devel"]
2127
steps:
22-
- uses: actions/checkout@v3
28+
- name: Checkout Code
29+
uses: actions/checkout@v3
2330
with:
2431
fetch-depth: 0
25-
- name: Cache nimble
32+
33+
- name: Cache Nimble Dependencies
2634
id: cache-nimble
2735
uses: buildjet/cache@v3
2836
with:
2937
path: ~/.nimble
30-
key: ${{ matrix.nim }}-nimble-${{ hashFiles('*.nimble') }}
38+
key: ${{ matrix.nim }}-nimble-v2-${{ hashFiles('*.nimble') }}
3139
restore-keys: |
32-
${{ matrix.nim }}-nimble-
33-
- uses: actions/setup-python@v4
40+
${{ matrix.nim }}-nimble-v2-
41+
42+
- name: Setup Python (3.10) with pip cache
43+
uses: actions/setup-python@v4
3444
with:
3545
python-version: "3.10"
36-
cache: "pip"
37-
- uses: jiro4989/setup-nim-action@v1
46+
cache: pip
47+
48+
- name: Setup Nim
49+
uses: jiro4989/setup-nim-action@v2
3850
with:
3951
nim-version: ${{ matrix.nim }}
52+
use-nightlies: true
4053
repo-token: ${{ secrets.GITHUB_TOKEN }}
41-
- run: nimble build -d:release -Y
42-
- run: pip install seleniumbase
43-
- run: seleniumbase install chromedriver
44-
- uses: supercharge/[email protected]
45-
- name: Prepare Nitter
54+
55+
- name: Build Project
56+
run: nimble build -d:release -Y
57+
58+
integration-test:
59+
name: Full integration test
60+
runs-on: buildjet-2vcpu-ubuntu-2204
61+
steps:
62+
- name: Checkout code
63+
uses: actions/checkout@v3
64+
with:
65+
fetch-depth: 0
66+
67+
- name: Cache Nimble Dependencies
68+
id: cache-nimble
69+
uses: buildjet/cache@v3
70+
with:
71+
path: ~/.nimble
72+
key: devel-nimble-v2-${{ hashFiles('*.nimble') }}
73+
restore-keys: |
74+
devel-nimble-v2-
75+
76+
- name: Setup Python (3.10) with pip cache
77+
uses: actions/setup-python@v4
78+
with:
79+
python-version: "3.10"
80+
cache: pip
81+
82+
- name: Setup Nim
83+
uses: jiro4989/setup-nim-action@v2
84+
with:
85+
nim-version: devel
86+
use-nightlies: true
87+
repo-token: ${{ secrets.GITHUB_TOKEN }}
88+
89+
- name: Build Project
90+
run: nimble build -d:release -Y
91+
92+
- name: Install SeleniumBase and Chromedriver
4693
run: |
47-
sudo apt install libsass-dev -y
94+
pip install seleniumbase
95+
seleniumbase install chromedriver
96+
97+
- name: Start Redis Service
98+
uses: supercharge/[email protected]
99+
100+
- name: Prepare Nitter Environment
101+
run: |
102+
sudo apt-get update && sudo apt-get install -y libsass-dev
48103
cp nitter.example.conf nitter.conf
49104
sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
50105
nimble md
51106
nimble scss
107+
echo '${{ secrets.SESSIONS }}' | head -n1
52108
echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl
53-
- name: Run tests
109+
110+
- name: Run Tests
54111
run: |
55112
./nitter &
56113
pytest -n3 tests

0 commit comments

Comments
 (0)