From 2f1135077fb05f0496f4c21b7684649533dcca59 Mon Sep 17 00:00:00 2001 From: Matt Leon <108271225+wydengyre@users.noreply.github.com> Date: Mon, 25 Mar 2024 15:11:53 +0800 Subject: [PATCH] gha: use setup-node --- .github/dependabot.yml | 22 ++++++++++++++++++++++ .github/workflows/ci.yml | 12 ++++++------ .node-version | 1 + 3 files changed, 29 insertions(+), 6 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .node-version diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..f97eba4 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,22 @@ +version: 2 +updates: + - package-ecosystem: github-actions + directory: / + schedule: + interval: daily + - package-ecosystem: npm + directory: / + schedule: + interval: daily + - package-ecosystem: npm + directory: /examples/node-cli + schedule: + interval: daily + - package-ecosystem: npm + directory: /examples/node-server + schedule: + interval: daily + - package-ecosystem: npm + directory: /examples/web + schedule: + interval: daily diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index af0691f..29da5a7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,16 +5,16 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout - uses: actions/checkout@v2 - - name: Cache the node_modules dir - uses: actions/cache@v2 + uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2 + - uses: actions/setup-node@60edb5dd545a775178f52524783378180af0d1f8 # v4.0.2 with: - path: node_modules - key: ${{ runner.os }}-node_modules-${{ hashFiles('package-lock.json') }} + node-version-file: '.node-version' + cache: 'npm' + cache-dependency-path: 'package-lock.json' - name: Install run: | sudo apt-get install clang-format ninja-build - npm install + npm ci - name: Build library run: make lib - name: Build examples diff --git a/.node-version b/.node-version new file mode 100644 index 0000000..726a201 --- /dev/null +++ b/.node-version @@ -0,0 +1 @@ +20.11.1 \ No newline at end of file