【发布时间】:2020-04-05 07:49:22
【问题描述】:
我想在多个环境中运行 GitHub Actions,比如说在 Windows 和 Linux 上。我设法用 Travis CI 做到了,但我找不到关于如何用 GitHub Actions 做到这一点的信息。
有人试过吗?
这是我的 nodejs.yml。
name: Node CI
on: [push]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [12.x]
steps:
- uses: actions/checkout@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: npm install
run: |
npm ci
- name: prettier format check
run: |
npm run prettier-check
- name: lint format check
run: |
npm run lint-check
- name: build, and test
run: |
npm run build
npm test --if-present
env:
CI: true
【问题讨论】:
标签: github continuous-integration github-actions