Skip to content

Commit

Permalink
Merge pull request #27 from Mouwf/feature/add-ci-workflow
Browse files Browse the repository at this point in the history
GitHub ActionsでCIをできるようにした
  • Loading branch information
eigoninaritai-naokichi authored Jan 8, 2024
2 parents a8fc33b + 419a451 commit 7a4e771
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Continuous Integration Pipeline
on:
pull_request:
workflow_dispatch:
jobs:
build_node_18:
runs-on: ubuntu-latest
environment:
name: develop
steps:
- uses: actions/checkout@v4
- name: Use Node.js 18.x
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'
- name: Run npm audit
run: npm audit --production --audit-level=moderate
- name: Install dependencies
run: npm ci
- name: Run Jest tests
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
run: npm run test:all
build_node_20:
needs: build_node_18
runs-on: ubuntu-latest
environment:
name: develop
steps:
- uses: actions/checkout@v4
- name: Use Node.js 20.x
uses: actions/setup-node@v4
with:
node-version: 20.x
cache: 'npm'
- name: Run npm audit
run: npm audit --production --audit-level=moderate
- name: Install dependencies
run: npm ci
- name: Run Jest tests
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
run: npm run test:all
25 changes: 25 additions & 0 deletions .github/workflows/nodejs_unit_tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Node.js Unit Tests
on:
push:
workflow_dispatch:
jobs:
test:
runs-on: ubuntu-latest
environment:
name: develop
strategy:
matrix:
node-version: [18.x, 20.x]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run Unit Tests
env:
FIREBASE_API_KEY: ${{ secrets.FIREBASE_API_KEY }}
run: npm run test

0 comments on commit 7a4e771

Please sign in to comment.