【发布时间】:2021-04-11 19:16:03
【问题描述】:
我目前正在使用 Jest、Docker 和 dynamodb-local 容器编写本地集成测试。
我通过启动容器然后jest --watchAll --coverage --runInBand 来做到这一点,以便测试按顺序运行并且不会相互中断。
我使用 GitHub Actions 来运行单元测试,但我还想继续使用 GitHub Actions 来进行这些集成测试。我目前的一个无法运行 NPM。如何正确配置操作?
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages
name: Node.js Package
on:
push:
branches:
- "main"
# OLD UNIT TESTS that worked
# jobs:
# build:
# runs-on: ubuntu-latest
# steps:
# - uses: actions/checkout@v2
# - uses: actions/setup-node@v1
# with:
# node-version: 12
# - run: npm ci
# - run: npm test
jobs:
vm:
runs-on: ubuntu-latest
steps:
- run: |
echo This job does not specify a container.
echo It runs directly on the virtual machine.
name: Run on VM
container:
runs-on: ubuntu-latest
container: amazon/dynamodb-local
steps:
name: Run in container
- run: npm ci
- run: npm test
【问题讨论】:
标签: node.js docker amazon-dynamodb github-actions