-
Notifications
You must be signed in to change notification settings - Fork 10
92 lines (72 loc) · 2.22 KB
/
pr.yaml
File metadata and controls
92 lines (72 loc) · 2.22 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: PR Checks and Tests
on:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
checks:
name: Checks
runs-on: ubuntu-latest
env:
CI: true
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version-file: .nvmrc
- name: yarn install
run: yarn install --immutable
- name: type checking and declarations
run: yarn tsc
- name: linter
run: yarn lint:check
- name: prettier
run: yarn prettier:check
- name: build all packages
run: yarn backstage-cli repo build --all
- name: publish check
run: yarn backstage-cli repo fix --check --publish
- name: test changed packages
run: yarn backstage-cli repo test --coverage --maxWorkers=3
- name: ensure clean working directory
run: |
if files=$(git ls-files --exclude-standard --others --modified) && [[ -z "$files" ]]; then
exit 0
else
echo ""
echo "Working directory has been modified:"
echo ""
git status --short
echo ""
git diff
exit 1
fi
tests:
name: Tests
runs-on: ubuntu-latest
env:
CI: true
COMMUNITY_PLUGINS_REPO_ARCHIVE: /tmp/community-plugins-repo.tar.gz
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v
- name: Set up Node
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
cache: 'yarn'
node-version-file: .nvmrc
- name: yarn install
run: yarn install --immutable
- name: run unit tests
run: yarn test
- name: Cache Backstage Community Repo
id: backstage-community-repo-cache
uses: actions/cache@v4
with:
path: ${{ env.COMMUNITY_PLUGINS_REPO_ARCHIVE }}
key: ${{ runner.os }}-backstage-community-repo
- name: run e2e tests
run: yarn test:e2e