-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #283 from proto-graphql/izumin5210/ci
ci: refactor workflows
- Loading branch information
Showing
4 changed files
with
71 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: "Setup Node environment" | ||
description: "Setup Node.js environment" | ||
inputs: | ||
node-version: | ||
description: Node.js version | ||
default: "18.x" | ||
runs: | ||
using: "composite" | ||
steps: | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ inputs.node-version }} | ||
cache: "pnpm" | ||
- run: corepack enable | ||
shell: bash | ||
- run: pnpm install --frozen-lockfile | ||
shell: bash |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,67 @@ | ||
name: CI | ||
|
||
on: [push] | ||
on: | ||
pull_request: | ||
branches: | ||
- "**" | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-node | ||
- run: pnpm lint | ||
- name: check code is up to date | ||
run: git diff --exit-code | ||
|
||
format: | ||
name: Format | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-node | ||
- run: pnpm format | ||
- name: check code is up to date | ||
run: git diff --exit-code | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 18.x | ||
cache: 'pnpm' | ||
- uses: bufbuild/buf-setup-action@v1 | ||
with: | ||
github_token: ${{ github.token }} | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm test | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@v1.1.2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: packages/protoc-gen-nexus/coverage/lcov.info | ||
base-path: packages/protoc-gen-nexus | ||
- uses: actions/checkout@v3 | ||
- uses: ./.github/actions/setup-node | ||
- run: pnpm test | ||
- name: check code is up to date | ||
run: git diff --exit-code | ||
- name: Coveralls | ||
uses: coverallsapp/github-action@v1.1.2 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
path-to-lcov: packages/protoc-gen-nexus/coverage/lcov.info | ||
base-path: packages/protoc-gen-nexus | ||
|
||
test-e2e: | ||
name: E2E Test - Node.js v${{ matrix.node-version }} | ||
strategy: | ||
matrix: | ||
node-version: [16, 18] | ||
node-version: ["16.x", "18.x"] | ||
fail-fast: false | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
- uses: pnpm/action-setup@v2 | ||
with: | ||
version: 7 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
cache: 'pnpm' | ||
- uses: bufbuild/buf-setup-action@v1 | ||
with: | ||
github_token: ${{ github.token }} | ||
- run: pnpm install --frozen-lockfile | ||
- run: pnpm test:e2e | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: ./.github/actions/setup-node | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- uses: bufbuild/buf-setup-action@v1 | ||
with: | ||
github_token: ${{ github.token }} | ||
- run: pnpm test:e2e | ||
- name: check code is up to date | ||
run: git diff --exit-code |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters