|
8 | 8 | - master
|
9 | 9 | workflow_call:
|
10 | 10 |
|
| 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 | + |
11 | 20 | jobs:
|
12 |
| - test: |
| 21 | + build-test: |
| 22 | + name: Build and test |
13 | 23 | runs-on: buildjet-2vcpu-ubuntu-2204
|
14 | 24 | strategy:
|
15 | 25 | 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"] |
21 | 27 | steps:
|
22 |
| - - uses: actions/checkout@v3 |
| 28 | + - name: Checkout Code |
| 29 | + uses: actions/checkout@v4 |
23 | 30 | with:
|
24 | 31 | fetch-depth: 0
|
25 |
| - - name: Cache nimble |
| 32 | + |
| 33 | + - name: Cache Nimble Dependencies |
26 | 34 | id: cache-nimble
|
27 |
| - uses: buildjet/cache@v3 |
| 35 | + uses: buildjet/cache@v4 |
28 | 36 | with:
|
29 | 37 | path: ~/.nimble
|
30 |
| - key: ${{ matrix.nim }}-nimble-${{ hashFiles('*.nimble') }} |
| 38 | + key: ${{ matrix.nim }}-nimble-v2-${{ hashFiles('*.nimble') }} |
31 | 39 | restore-keys: |
|
32 |
| - ${{ matrix.nim }}-nimble- |
33 |
| - - uses: actions/setup-python@v4 |
| 40 | + ${{ matrix.nim }}-nimble-v2- |
| 41 | +
|
| 42 | + - name: Setup Nim |
| 43 | + uses: jiro4989/setup-nim-action@v2 |
| 44 | + with: |
| 45 | + nim-version: ${{ matrix.nim }} |
| 46 | + use-nightlies: true |
| 47 | + repo-token: ${{ secrets.GITHUB_TOKEN }} |
| 48 | + |
| 49 | + - name: Build Project |
| 50 | + run: nimble build -d:release -Y |
| 51 | + |
| 52 | + integration-test: |
| 53 | + needs: [build-test] |
| 54 | + name: Integration test |
| 55 | + runs-on: buildjet-2vcpu-ubuntu-2204 |
| 56 | + steps: |
| 57 | + - name: Checkout code |
| 58 | + uses: actions/checkout@v4 |
| 59 | + with: |
| 60 | + fetch-depth: 0 |
| 61 | + |
| 62 | + - name: Cache Nimble Dependencies |
| 63 | + id: cache-nimble |
| 64 | + uses: buildjet/cache@v4 |
| 65 | + with: |
| 66 | + path: ~/.nimble |
| 67 | + key: devel-nimble-v2-${{ hashFiles('*.nimble') }} |
| 68 | + restore-keys: | |
| 69 | + devel-nimble-v2- |
| 70 | +
|
| 71 | + - name: Setup Python (3.10) with pip cache |
| 72 | + uses: buildjet/setup-python@v4 |
34 | 73 | with:
|
35 | 74 | python-version: "3.10"
|
36 |
| - cache: "pip" |
37 |
| - - uses: jiro4989/setup-nim-action@v1 |
| 75 | + cache: pip |
| 76 | + |
| 77 | + - name: Setup Nim |
| 78 | + uses: jiro4989/setup-nim-action@v2 |
38 | 79 | with:
|
39 |
| - nim-version: ${{ matrix.nim }} |
| 80 | + nim-version: devel |
| 81 | + use-nightlies: true |
40 | 82 | 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 |
| 83 | + |
| 84 | + - name: Build Project |
| 85 | + run: nimble build -d:release -Y |
| 86 | + |
| 87 | + - name: Install SeleniumBase and Chromedriver |
| 88 | + run: | |
| 89 | + pip install seleniumbase |
| 90 | + seleniumbase install chromedriver |
| 91 | +
|
| 92 | + - name: Start Redis Service |
| 93 | + uses: supercharge/[email protected] |
| 94 | + |
| 95 | + - name: Prepare Nitter Environment |
46 | 96 | run: |
|
47 |
| - sudo apt install libsass-dev -y |
| 97 | + sudo apt-get update && sudo apt-get install -y libsass-dev |
48 | 98 | cp nitter.example.conf nitter.conf
|
49 | 99 | sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
|
50 | 100 | nimble md
|
51 | 101 | nimble scss
|
| 102 | + echo '${{ secrets.SESSIONS }}' | head -n1 |
52 | 103 | echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl
|
53 |
| - - name: Run tests |
| 104 | +
|
| 105 | + - name: Run Tests |
54 | 106 | run: |
|
55 | 107 | ./nitter &
|
56 | 108 | pytest -n3 tests
|
0 commit comments