|
| 1 | +name: Javascript tests |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + push: |
| 6 | + branches: |
| 7 | + - '**' |
| 8 | + |
| 9 | +jobs: |
| 10 | + run_tests: |
| 11 | + name: JS |
| 12 | + runs-on: ${{ matrix.os }} |
| 13 | + strategy: |
| 14 | + matrix: |
| 15 | + os: [ubuntu-latest] |
| 16 | + node-version: [20] |
| 17 | + python-version: ['3.11', '3.12'] |
| 18 | + |
| 19 | + steps: |
| 20 | + - uses: actions/checkout@v4 |
| 21 | + - name: Fetch main to compare coverage |
| 22 | + run: git fetch --depth=1 origin main |
| 23 | + |
| 24 | + - name: Setup Node |
| 25 | + uses: actions/setup-node@v4 |
| 26 | + with: |
| 27 | + node-version: ${{ matrix.node-version }} |
| 28 | + |
| 29 | + - name: Setup npm |
| 30 | + run: npm i -g npm@10.7.x |
| 31 | + |
| 32 | + - name: Install Firefox 123.0 |
| 33 | + run: | |
| 34 | + sudo apt-get purge firefox |
| 35 | + wget "https://ftp.mozilla.org/pub/firefox/releases/123.0/linux-x86_64/en-US/firefox-123.0.tar.bz2" |
| 36 | + tar -xjf firefox-123.0.tar.bz2 |
| 37 | + sudo mv firefox /opt/firefox |
| 38 | + sudo ln -s /opt/firefox/firefox /usr/bin/firefox |
| 39 | +
|
| 40 | + - name: Install Required System Packages |
| 41 | + run: sudo apt-get update && sudo apt-get install -y libxmlsec1-dev ubuntu-restricted-extras xvfb |
| 42 | + |
| 43 | + - name: Setup Python |
| 44 | + uses: actions/setup-python@v5 |
| 45 | + with: |
| 46 | + python-version: ${{ matrix.python-version }} |
| 47 | + |
| 48 | + - name: Get pip cache dir |
| 49 | + id: pip-cache-dir |
| 50 | + run: | |
| 51 | + echo "dir=$(pip cache dir)" >> $GITHUB_OUTPUT |
| 52 | +
|
| 53 | + - name: Cache pip dependencies |
| 54 | + id: cache-dependencies |
| 55 | + uses: actions/cache@v4 |
| 56 | + with: |
| 57 | + path: ${{ steps.pip-cache-dir.outputs.dir }} |
| 58 | + key: ${{ runner.os }}-pip-${{ hashFiles('requirements/edx/base.txt') }} |
| 59 | + restore-keys: ${{ runner.os }}-pip- |
| 60 | + |
| 61 | + - name: Install Required Python Dependencies |
| 62 | + run: | |
| 63 | + pip install -r requirements/base.txt |
| 64 | +
|
| 65 | + - name: Install npm |
| 66 | + working-directory: ./xblocks_contrib/video |
| 67 | + run: npm ci |
| 68 | + |
| 69 | + - name: Run JS Tests |
| 70 | + working-directory: ./xblocks_contrib/video |
| 71 | + run: | |
| 72 | + npm run test |
| 73 | +
|
| 74 | + - name: Save Job Artifacts |
| 75 | + uses: actions/upload-artifact@v4 |
| 76 | + with: |
| 77 | + name: Build-Artifacts |
| 78 | + path: | |
| 79 | + reports/**/* |
| 80 | + test_root/log/*.png |
| 81 | + test_root/log/*.log |
| 82 | + **/TEST-*.xml |
| 83 | + overwrite: true |
0 commit comments