Repository navigation
93 lines (90 loc) · 3.67 KB
/
Copy pathpackage-ci.yml
File metadata and controls
93 lines (90 loc) · 3.67 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
93
name: "Package CI"
permissions:
statuses: write
checks: write
contents: read
on:
push:
pull_request:
jobs:
build-and-test:
name: Build & Test
runs-on: ubuntu-22.04
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version-file: ".nvmrc"
cache: "yarn"
cache-dependency-path: "**/yarn.lock"
- name: Restore Node.js dependencies
run: yarn install --immutable
- name: Restore package.json
# This step is necessary because the previous step may have updated package.json
run: git checkout -- package.json packages/*/package.json
- name: Audit dependencies
# Report findings without blocking builds until the tooling that needs tar 7 supports tar 8.
continue-on-error: true
run: |
audit_status=0
for scope in . packages/node-sdk/examples/cloudflare-worker packages/openfeature-node-provider/example; do
echo "Auditing $scope"
if ! (cd "$scope" && yarn npm audit --all --recursive --no-deprecations); then
echo "::warning::Dependency audit did not pass for $scope; see the audit output."
audit_status=1
fi
done
exit "$audit_status"
- name: Check dependency tooling
run: yarn test:tooling
- name: Check release channel safeguards
run: yarn test:release
- name: Install Playwright Browsers
run: yarn playwright install --with-deps
working-directory: ./packages/browser-sdk
- id: build
name: Build the project
run: yarn build
- name: Check generated CLI declarations
run: node packages/cli/test/generated-types.mjs
- name: Build docs
run: yarn docs
- name: Test documentation publication boundaries
run: yarn test:docs-publishing
- id: test
name: Test the project
run: yarn test:ci
- name: Check standalone examples
run: |
for example in packages/node-sdk/examples/cloudflare-worker packages/openfeature-node-provider/example; do
(cd "$example" && yarn install --immutable && yarn build && yarn test:ci)
done
- name: Check native development tooling
run: |
yarn workspace reflag-react-native-sdk-bare-rn react-native config > "$RUNNER_TEMP/native-config.json"
yarn tsc --project packages/react-native-sdk/dev/bare-rn/tsconfig.json --noEmit
yarn tsc --project packages/react-native-sdk/dev/expo/tsconfig.json --noEmit
for platform in ios android; do
yarn workspace reflag-react-native-sdk-bare-rn react-native bundle --platform "$platform" --dev false --entry-file index.js --bundle-output "$RUNNER_TEMP/bare-$platform.bundle" --assets-dest "$RUNNER_TEMP/bare-$platform-assets" --max-workers 2
yarn workspace reflag-react-sdk-expo expo export --platform "$platform" --output-dir "$RUNNER_TEMP/expo-$platform" --max-workers 2
done
- name: Report test results
uses: dorny/test-reporter@v1.6.0
# Reporting only. Failing tests already fail the "Test the project"
# step; a reporter API error (seen on merge queue commits) shouldn't
# fail the required "Build & Test" job.
continue-on-error: true
with:
name: Build & Test Report
path: ./packages/*/junit.xml
reporter: jest-junit
- id: fmt
name: Check formatting
run: yarn fmt
- id: lint
name: Check for linting errors
run: yarn lint:ci