Skip to content

Commit c9cedbd

Browse files
authored
build: attempt to fix build (#16)
### TL;DR Improved CI workflow caching and updated registry fork reference. ### What changed? - Added disk cache and repository cache configurations to Bazel setup in CI and verify-hooks workflows - Updated the registry fork reference in the publish workflow from `myorg/bazel-central-registry` to `formatjs/bazel-central-registry` - Removed the test script from `examples/aggregate/app/test.sh` - Removed the `.npmrc` file from `examples/simple` ### How to test? - Run the CI workflows to verify that the Bazel caching is working correctly - Verify that the publish workflow correctly references the `formatjs/bazel-central-registry` fork - Ensure that the examples still build and run correctly without the removed files ### Why make this change? - The Bazel caching improvements will speed up CI builds by reusing build artifacts between runs - Updating the registry fork reference ensures that PRs are opened in the correct repository - Removing unused test scripts and configuration files helps maintain a cleaner codebase
1 parent 0541974 commit c9cedbd

22 files changed

Lines changed: 124 additions & 196 deletions

.bcr/presubmit.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
bcr_test_module:
2-
module_path: "e2e/smoke"
2+
module_path: "examples/simple"
33
matrix:
4-
platform: ["debian10", "macos", "ubuntu2004", "windows"]
5-
bazel: ["8.x", "7.x", "6.x"]
4+
platform: ["debian10", "macos", "ubuntu2004"]
5+
bazel: ["8.x"]
66
tasks:
77
run_tests:
88
name: "Run test module"

.github/workflows/ci.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,20 @@ jobs:
2424
- uses: bazel-contrib/setup-bazel@0.16.0
2525
with:
2626
bazelisk-cache: true
27+
disk-cache: ${{ github.workflow }}
28+
repository-cache: true
29+
2730
- name: Test ${{ matrix.folder }}
2831
working-directory: ${{ matrix.folder }}
2932
run: bazel test //...
33+
34+
- name: Upload test logs
35+
if: failure()
36+
uses: actions/upload-artifact@v4
37+
with:
38+
name: test-logs-${{ matrix.os }}-${{ hashFiles(matrix.folder) }}
39+
path: |
40+
${{ matrix.folder }}/bazel-testlogs/**/test.log
41+
${{ matrix.folder }}/bazel-testlogs/**/test.xml
42+
if-no-files-found: warn
43+
retention-days: 7

.github/workflows/publish.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
with:
2626
tag_name: ${{ inputs.tag_name }}
2727
# GitHub repository which is a fork of the upstream where the Pull Request will be opened.
28-
registry_fork: myorg/bazel-central-registry
28+
registry_fork: formatjs/bazel-central-registry
2929
permissions:
3030
attestations: write
3131
contents: write

.github/workflows/release_prep.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,5 +35,5 @@ bazel_dep(name = "rules_formatjs", version = "${TAG:1}")
3535
3636
EOF
3737

38-
awk 'f;/--SNIP--/{f=1}' e2e/smoke/WORKSPACE.bazel
38+
awk 'f;/--SNIP--/{f=1}' examples/simple/MODULE.bazel
3939
echo "\`\`\`"

.github/workflows/verify-hooks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ jobs:
2323
- uses: bazel-contrib/setup-bazel@0.16.0
2424
with:
2525
bazelisk-cache: true
26+
disk-cache: ${{ github.workflow }}
27+
repository-cache: true
28+
2629
- name: Get changed files
2730
id: changed-files
2831
run: |

MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ bazel_dep(name = "bazelrc-preset.bzl", version = "1.6.0")
4646

4747
# FormatJS CLI toolchain
4848
formatjs_cli = use_extension("//formatjs_cli:extensions.bzl", "formatjs_cli")
49-
formatjs_cli.toolchain(version = "0.1.0")
49+
formatjs_cli.toolchain(version = "0.1.2")
5050
use_repo(
5151
formatjs_cli,
5252
"formatjs_cli_toolchains_darwin_arm64",

MODULE.bazel.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/aggregate/MODULE.bazel.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/aggregate/app/App.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import {Module1Messages} from '../module1/Messages'
2-
import {Module2Messages} from '../module2/Messages'
3-
import {Module3Messages} from '../module3/Messages'
1+
import { Module1Messages } from "../module1/Messages";
2+
import { Module2Messages } from "../module2/Messages";
3+
import { Module3Messages } from "../module3/Messages";
44

55
export function App() {
66
return (
@@ -9,5 +9,5 @@ export function App() {
99
<Module2Messages />
1010
<Module3Messages />
1111
</>
12-
)
12+
);
1313
}
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,24 @@
11
{
2+
"common.cancel": {
3+
"id": "common.cancel",
4+
"defaultMessage": "Cancel",
5+
"description": "Common cancel button"
6+
},
7+
"common.save": {
8+
"id": "common.save",
9+
"defaultMessage": "Save",
10+
"description": "Common save button"
11+
},
12+
"module1.description": {
13+
"id": "module1.description",
14+
"defaultMessage": "This is the first module",
15+
"description": "Description for module 1"
16+
},
17+
"module1.title": {
18+
"id": "module1.title",
19+
"defaultMessage": "Module 1 Title",
20+
"description": "Title for module 1"
21+
},
222
"module2.description": {
323
"id": "module2.description",
424
"defaultMessage": "This is the second module",
@@ -9,11 +29,6 @@
929
"defaultMessage": "Module 2 Title",
1030
"description": "Title for module 2"
1131
},
12-
"common.save": {
13-
"id": "common.save",
14-
"defaultMessage": "Save",
15-
"description": "Common save button"
16-
},
1732
"module3.description": {
1833
"id": "module3.description",
1934
"defaultMessage": "This is the third module",
@@ -23,20 +38,5 @@
2338
"id": "module3.title",
2439
"defaultMessage": "Module 3 Title",
2540
"description": "Title for module 3"
26-
},
27-
"common.cancel": {
28-
"id": "common.cancel",
29-
"defaultMessage": "Cancel",
30-
"description": "Common cancel button"
31-
},
32-
"module1.title": {
33-
"id": "module1.title",
34-
"defaultMessage": "Module 1 Title",
35-
"description": "Title for module 1"
36-
},
37-
"module1.description": {
38-
"id": "module1.description",
39-
"defaultMessage": "This is the first module",
40-
"description": "Description for module 1"
4141
}
4242
}

0 commit comments

Comments
 (0)