-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (56 loc) · 1.78 KB
/
lint-build-test.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
name: Lint Test Build Workflow
on:
push:
branches: ['main']
pull_request:
branches: ['main']
workflow_dispatch: {}
jobs:
LintTestBuild:
permissions:
# Needed for nx-set-shas when run on the main branch
actions: read
contents: read
name: Lint Test Build Job
env:
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
# checkout
- name: Checkout Repo
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4
with:
fetch-depth: 0
lfs: true
# persist-credentials: false
- uses: ./.github/actions/ci-setup
name: Setup CI environment
# testing nx affected
- name:
Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@40f1175ceec169e68c9857c27aa7c5063692aa9a # v4
with:
# must compare to branch
main-branch-name: 'main'
- run: |
echo "BASE: ${{ env.NX_BASE }}"
echo "HEAD: ${{ env.NX_HEAD }}"
- name: Set up main branch for affected commands in PR
run: git branch --track main origin/main
if: ${{ github.event_name == 'pull_request' }}
# run affected or run-many commands
- name: lint
run: nx run-many -t lint
- name: test
run: nx run-many -t test
- name: build
run: nx run-many -t build
- name: Upload coverage reports to Codecov
if:
(github.actor != 'dependabot[bot]') && (github.actor !=
'renovate[bot]')
uses: codecov/codecov-action@e28ff129e5465c2c0dcc6f003fc735cb6ae0c673 # v4.5.0
with:
token: ${{ secrets.CODECOV_TOKEN }}