Skip to content

Commit

Permalink
ci: Github actions configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
cmath10 committed May 22, 2024
1 parent 1300ba5 commit 3226c71
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Tests

on: [push, pull_request]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
eslint:
runs-on: ubuntu-latest

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

steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4

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

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: .yarn
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-
- name: Install dependencies
run: yarn install

- name: Run lint
run: yarn lint

tests:
needs: eslint

timeout-minutes: 60
runs-on: ubuntu-latest

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

steps:
- name: Using branch ${{ github.ref }} for repository ${{ github.repository }}.
uses: actions/checkout@v4

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

- name: Cache dependencies
id: cache-deps
uses: actions/cache@v4
with:
path: .yarn
key: ${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-node-${{ matrix.node-version }}-yarn-
- name: Install dependencies
run: yarn install

- name: Run tests
run: yarn test

0 comments on commit 3226c71

Please sign in to comment.