Skip to content

Commit

Permalink
ci: add workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-sa committed Sep 11, 2023
1 parent 93b2034 commit 995f6d2
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: Node.js version
required: true
default: 18.7.1
default: 18.17.0

pnpm-version:
description: pnpm version
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/build-test-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
on:
workflow_call:
inputs:
skip:
default: ''
required: false
type: string

env:
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}
NX_VERBOSE_LOGGING: ${{ secrets.NX_VERBOSE_LOGGING }}
NX_SKIP_NX_CACHE: ${{ secrets.NX_SKIP_NX_CACHE }}
NX_TASKS_RUNNER: ${{ secrets.NX_TASKS_RUNNER }}
NX_PERF_LOGGING: ${{ secrets.NX_PERF_LOGGING }}

permissions:
contents: read
actions: read
pull-requests: read
id-token: write

jobs:
build:
runs-on: buildjet-2vcpu-ubuntu-2004
if: contains(inputs.skip, 'build') == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
id: setup
uses: ./.github/actions/setup

- name: Run affected builds
run: pnpm nx affected:build

test:
runs-on: buildjet-2vcpu-ubuntu-2004
if: contains(inputs.skip, 'test') == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
id: setup
uses: ./.github/actions/setup

- name: Run affected tests
run: pnpm nx affected:test

lint:
runs-on: buildjet-2vcpu-ubuntu-2004
if: contains(inputs.skip, 'lint') == false
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Setup
id: setup
uses: ./.github/actions/setup

- name: Run affected linting
run: pnpm nx affected:lint
27 changes: 27 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

env:
NX_VERBOSE_LOGGING: ${{ secrets.NX_VERBOSE_LOGGING }}
NX_SKIP_NX_CACHE: ${{ secrets.NX_SKIP_NX_CACHE }}
NX_TASKS_RUNNER: ${{ secrets.NX_TASKS_RUNNER }}
NX_PERF_LOGGING: ${{ secrets.NX_PERF_LOGGING }}
NX_CLOUD_ENCRYPTION_KEY: ${{ secrets.NX_CLOUD_ENCRYPTION_KEY }}
NX_CLOUD_AUTH_TOKEN: ${{ secrets.NX_CLOUD_AUTH_TOKEN }}

permissions:
actions: write
contents: read
pull-requests: write
id-token: write

jobs:
build-test-lint:
uses: ./.github/workflows/build-test-lint.yml
secrets: inherit
with:
skip: lint

0 comments on commit 995f6d2

Please sign in to comment.