From 1e88eb230ade6f1b72fd97db522707f145bf9cbc Mon Sep 17 00:00:00 2001 From: razinj Date: Sun, 23 Jun 2024 22:33:37 +0200 Subject: [PATCH] feat: update existing test workflow and add a new code styles workflow --- .github/workflows/code-style.yml | 18 ++++++++++++++++++ .github/workflows/test.yml | 13 ++++++++++--- package.json | 3 ++- 3 files changed, 30 insertions(+), 4 deletions(-) create mode 100644 .github/workflows/code-style.yml diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml new file mode 100644 index 0000000..04b3496 --- /dev/null +++ b/.github/workflows/code-style.yml @@ -0,0 +1,18 @@ +name: Code Style + +on: [push] + +jobs: + check-formatting: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Use Node.js 20 + uses: actions/setup-node@v4 + with: + node-version: '20.x' + - name: Install Dependencies + run: npm ci + - name: Check Formatting + run: npm run format:ci + # TODO: Add linting check diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 91f6ce1..460286a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,12 +1,19 @@ -name: 'Tests' +name: Tests -on: push +on: [push] jobs: jest-tests: + strategy: + matrix: + node-version: ['18.x', '20.x'] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} - name: Install Dependencies run: npm ci - name: Run Tests diff --git a/package.json b/package.json index c56c6d5..65981bd 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "test:ci": "jest --ci --no-cache --silent", "test:coverage": "jest --collect-coverage", "lint": "eslint . --ext .js,.ts,.tsx", - "format": "prettier --write ." + "format": "prettier --write .", + "format:ci": "prettier --check ." }, "dependencies": { "@react-native-async-storage/async-storage": "^1.23.1",