Skip to content

Commit

Permalink
Workflows: Refactor ENV vars and add scheduled e2e step
Browse files Browse the repository at this point in the history
  • Loading branch information
audiodude committed Jul 7, 2024
1 parent 372f0c7 commit 2dbf151
Showing 1 changed file with 41 additions and 38 deletions.
79 changes: 41 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,51 +5,54 @@ on:
push:
branches:
- main
env:
REDIS: 'redis://127.0.0.1:6379'
S3_URL: ${{ secrets.S3_URL }}
ZIMCHECK_PATH: $( find .. -name zimcheck )
ZIMDUMP_PATH: $( find .. -name zimdump )

jobs:
build:

runs-on: ubuntu-22.04

strategy:
matrix:
node-version: [18.x]

steps:

- name: Installing Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Installing Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '6.x'

- name: Downloading code
uses: actions/checkout@v4

- name: Installing other dependencies
run: |
npm install
npm i -g eslint
npm i -g codecov
wget -qO- https://download.openzim.org/release/zim-tools/zim-tools_linux-x86_64.tar.gz | tar xvz
- name: Running ESLint
run: npm run lint

- name: Running tests
run: npm run codecov
env:
REDIS: 'redis://127.0.0.1:6379'
S3_URL: ${{ secrets.S3_URL }}
ZIMCHECK_PATH: $( find .. -name zimcheck )
ZIMDUMP_PATH: $( find .. -name zimdump )

- name: Uploading Codecov stats
uses: codecov/codecov-action@v4
if: ${{ matrix.node-version == '18.x' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Installing Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

- name: Installing Redis
uses: shogo82148/actions-setup-redis@v1
with:
redis-version: '6.x'

- name: Downloading code
uses: actions/checkout@v4

- name: Installing other dependencies
run: |
npm install
npm i -g eslint
npm i -g codecov
wget -qO- https://download.openzim.org/release/zim-tools/zim-tools_linux-x86_64.tar.gz | tar xvz
- name: Running ESLint
run: npm run lint

- name: Running all tests (w/coverage)
if: ${{ github.event_name != 'schedule' }}
run: npm run codecov

- name: Running scheduled e2e tests (no coverage)
if: ${{ github.event_name == 'schedule' }}
run: npm run test:e2e

- name: Uploading Codecov stats
uses: codecov/codecov-action@v4
if: ${{ matrix.node-version == '18.x' }}
with:
token: ${{ secrets.CODECOV_TOKEN }}

0 comments on commit 2dbf151

Please sign in to comment.