|
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@v3 |
23 | 30 | with:
|
24 | 31 | fetch-depth: 0
|
25 |
| - - name: Cache nimble |
| 32 | + |
| 33 | + - name: Cache Nimble Dependencies |
26 | 34 | id: cache-nimble
|
27 | 35 | uses: buildjet/cache@v3
|
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 Python (3.10) with pip cache |
| 43 | + uses: actions/setup-python@v4 |
34 | 44 | with:
|
35 | 45 | 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 |
38 | 50 | with:
|
39 | 51 | nim-version: ${{ matrix.nim }}
|
40 | 52 | 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 |
46 | 91 | 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 |
48 | 101 | cp nitter.example.conf nitter.conf
|
49 | 102 | sed -i 's/enableDebug = false/enableDebug = true/g' nitter.conf
|
50 | 103 | nimble md
|
51 | 104 | nimble scss
|
| 105 | + echo '${{ secrets.SESSIONS }}' | head -n1 |
52 | 106 | echo '${{ secrets.SESSIONS }}' > ./sessions.jsonl
|
53 |
| - - name: Run tests |
| 107 | +
|
| 108 | + - name: Run Tests |
54 | 109 | run: |
|
55 | 110 | ./nitter &
|
56 | 111 | pytest -n3 tests
|
0 commit comments