From 90bd4d16e6a5dac4bedbb3016ec1180310d63fa7 Mon Sep 17 00:00:00 2001 From: hhow09 Date: Wed, 22 Jan 2025 00:54:37 +0100 Subject: [PATCH] ci: github ci test --- .github/workflows/ci.yaml | 33 +++++++++++++++++++++++++++++++++ backend/.nvmrc | 1 + 2 files changed, 34 insertions(+) create mode 100644 .github/workflows/ci.yaml create mode 100644 backend/.nvmrc diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..3c04866 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,33 @@ +name: CI +on: + push: + branches: [ "master"] + paths-ignore: + - "README.md" + pull_request: + branches: [ "master" ] + +jobs: + test: + strategy: + matrix: + directory: [ "./backend" ] + name: 🎉 Test + runs-on: ubuntu-latest + steps: + - name: 🚚 Get latest code + uses: actions/checkout@v4 + - name: Setup node + uses: actions/setup-node@v4 + with: + node-version-file: ${{ matrix.directory }}/.nvmrc + - name: 📦 Install dependencies + working-directory: ${{ matrix.directory }} + run: npm ci + - name: Linter + working-directory: ${{ matrix.directory }} + run: npm run lint + - name: Test + working-directory: ${{ matrix.directory }} + run: npm test + \ No newline at end of file diff --git a/backend/.nvmrc b/backend/.nvmrc new file mode 100644 index 0000000..b427e2a --- /dev/null +++ b/backend/.nvmrc @@ -0,0 +1 @@ +v20.16.0 \ No newline at end of file