From b66e15f2944cf336f4df38a27cfbe11caab06f20 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Thu, 1 Jan 2026 14:33:08 +0100 Subject: [PATCH 1/3] Create CI GitHub action --- .github/workflows/ci.yml | 50 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..50df6847 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,50 @@ +name: CI Shariff-Plus + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + +jobs: + npm: + name: Install JS/CSS dependencies + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + uses: actions/setup-node@v4 + with: + node-version: latest + cache: 'npm' + - name: Run npm ci + - run: npm ci + + test: + name: Check Javascript & CSS code style and run test + runs-on: ubuntu-latest + needs: [npm] + steps: + - uses: actions/checkout@v4 + uses: actions/setup-node@v4 + with: + node-version: latest + cache: 'npm' + - name: Check code style and run test + - run: npm run test + + build: + name: Build distribution + runs-on: ubuntu-latest + needs: [npm] + steps: + - uses: actions/checkout@v4 + uses: actions/setup-node@v4 + with: + node-version: latest + cache: 'npm' + - name: Run build + - run: npm run build From d26aeec1e92c399c98db6d8e9b642289ef829ee4 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Thu, 1 Jan 2026 14:42:23 +0100 Subject: [PATCH 2/3] Fix syntax --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 50df6847..138ea3e5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,11 +16,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + - name: Run npm ci uses: actions/setup-node@v4 with: node-version: latest cache: 'npm' - - name: Run npm ci - run: npm ci test: @@ -29,11 +29,11 @@ jobs: needs: [npm] steps: - uses: actions/checkout@v4 + - name: Check code style and run test uses: actions/setup-node@v4 with: node-version: latest cache: 'npm' - - name: Check code style and run test - run: npm run test build: @@ -42,9 +42,9 @@ jobs: needs: [npm] steps: - uses: actions/checkout@v4 + - name: Run build uses: actions/setup-node@v4 with: node-version: latest cache: 'npm' - - name: Run build - run: npm run build From fc08576726023b47a33791600e6e3a614f604fe4 Mon Sep 17 00:00:00 2001 From: Richard Fath Date: Thu, 1 Jan 2026 15:29:31 +0100 Subject: [PATCH 3/3] Use cache --- .github/workflows/ci.yml | 53 ++++++++++++++++++++++++---------------- 1 file changed, 32 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 138ea3e5..037efc80 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -15,36 +15,47 @@ jobs: name: Install JS/CSS dependencies runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - name: Run npm ci - uses: actions/setup-node@v4 - with: - node-version: latest - cache: 'npm' - - run: npm ci + - uses: actions/checkout@v5 + - uses: actions/setup-node@v4 + with: + node-version: latest + - uses: actions/cache@v4 + id: cache-npm + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'src/**') }} + - name: Run npm ci + if: steps.cache-npm.outputs.cache-hit != 'true' + run: npm ci test: name: Check Javascript & CSS code style and run test runs-on: ubuntu-latest needs: [npm] steps: - - uses: actions/checkout@v4 - - name: Check code style and run test - uses: actions/setup-node@v4 - with: - node-version: latest - cache: 'npm' - - run: npm run test + - uses: actions/checkout@v5 + - uses: actions/setup-node@v4 + with: + node-version: latest + - uses: actions/cache/restore@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'src/**') }} + - name: Check code style and run unit test + run: npm run test build: name: Build distribution runs-on: ubuntu-latest needs: [npm] steps: - - uses: actions/checkout@v4 - - name: Run build - uses: actions/setup-node@v4 - with: - node-version: latest - cache: 'npm' - - run: npm run build + - uses: actions/checkout@v5 + - uses: actions/setup-node@v4 + with: + node-version: latest + - uses: actions/cache/restore@v4 + with: + path: node_modules + key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json', 'src/**') }} + - name: Run build + run: npm run build