diff --git a/.github/workflows/eslint.yml b/.github/workflows/eslint.yml deleted file mode 100644 index 3eda97d..0000000 --- a/.github/workflows/eslint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: eslint - -on: - push: - branches: - - master - pull_request: - -jobs: - eslint: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - uses: actions/setup-node@v3 - with: - node-version: "18" - - run: npm ci - - run: npm run lint diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..2e7e7c6 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,40 @@ +name: test + +on: + push: + branches: + - master + - dev + pull_request: + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: "18" + - run: npm ci + - run: npm run lint + build: + runs-on: ubuntu-latest + strategy: + matrix: + node-version: ["18", "20"] + steps: + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - name: Cache node_modules + uses: actions/cache@v2 + with: + path: | + ~/.npm + ~/.cache + key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node-${{ matrix.node-version }}- + - run: npm build