Skip to content

Commit d98c614

Browse files
committed
Build test
1 parent 54ba1e3 commit d98c614

File tree

1 file changed

+75
-20
lines changed

1 file changed

+75
-20
lines changed

.github/workflows/run-tests.yml

+75-20
Original file line numberDiff line numberDiff line change
@@ -8,49 +8,104 @@ 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 }}
4052
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
53+
54+
- name: Build Project
55+
run: nimble build -d:release -Y
56+
57+
integration-test:
58+
name: Full integration test
59+
runs-on: buildjet-2vcpu-ubuntu-2204
60+
steps:
61+
- name: Checkout code
62+
uses: actions/checkout@v3
63+
with:
64+
fetch-depth: 0
65+
66+
- name: Cache Nimble Dependencies
67+
id: cache-nimble
68+
uses: buildjet/cache@v3
69+
with:
70+
path: ~/.nimble
71+
key: devel-nimble-v2-${{ hashFiles('*.nimble') }}
72+
restore-keys: |
73+
devel-nimble-v2-
74+
75+
- name: Setup Python (3.10) with pip cache
76+
uses: actions/setup-python@v4
77+
with:
78+
python-version: "3.10"
79+
cache: pip
80+
81+
- name: Setup Nim
82+
uses: jiro4989/setup-nim-action@v2
83+
with:
84+
nim-version: devel
85+
repo-token: ${{ secrets.GITHUB_TOKEN }}
86+
87+
- name: Build Project
88+
run: nimble build -d:release -Y
89+
90+
- name: Install SeleniumBase and Chromedriver
4691
run: |
47-
sudo apt install libsass-dev -y
92+
pip install seleniumbase
93+
seleniumbase install chromedriver
94+
95+
- name: Start Redis Service
96+
uses: supercharge/[email protected]
97+
98+
- name: Prepare Nitter Environment
99+
run: |
100+
sudo apt-get update && sudo apt-get install -y libsass-dev
48101
cp nitter.example.conf nitter.conf
49102
sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
50103
nimble md
51104
nimble scss
105+
echo '${{ secrets.SESSIONS }}' | head -n1
52106
echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl
53-
- name: Run tests
107+
108+
- name: Run Tests
54109
run: |
55110
./nitter &
56111
pytest -n3 tests

0 commit comments

Comments
 (0)