Skip to content

Commit 3ab8b0b

Browse files
authored
feat: improve rules_fortran (#182)
* fix: setup-bazel github workflows * feat: improve rules_fortran Adds a separate modules attribute in order to support more complex builds of Fortran projects. Some projects have more complex first-party dependency management requirements, which can be solved with the new `modules` attribute.
1 parent 36e3e1f commit 3ab8b0b

6 files changed

Lines changed: 379 additions & 145 deletions

File tree

.github/workflows/default.yaml

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,16 @@ jobs:
2020
strategy:
2121
matrix:
2222
os:
23-
- ubuntu-20.04
2423
- ubuntu-22.04
24+
- ubuntu-24.04
2525
runs-on: ${{ matrix.os }}
2626
steps:
2727
- uses: actions/checkout@v4
28-
- uses: bazelbuild/setup-bazelisk@v2
28+
- uses: bazel-contrib/setup-bazel@0.15.0
29+
with:
30+
bazelisk-cache: true
31+
disk-cache: ${{ github.workflow }}
32+
repository-cache: true
2933
- name: Test
3034
run: |
3135
./.github/workflows/configurebb.sh
@@ -42,7 +46,11 @@ jobs:
4246
runs-on: ubuntu-22.04
4347
steps:
4448
- uses: actions/checkout@v4
45-
- uses: bazelbuild/setup-bazelisk@v2
49+
- uses: bazel-contrib/setup-bazel@0.15.0
50+
with:
51+
bazelisk-cache: true
52+
disk-cache: ${{ github.workflow }}
53+
repository-cache: true
4654
- name: Test
4755
run: |
4856
./.github/workflows/configurebb.sh
@@ -60,7 +68,11 @@ jobs:
6068
runs-on: ubuntu-22.04
6169
steps:
6270
- uses: actions/checkout@v4
63-
- uses: bazelbuild/setup-bazelisk@v2
71+
- uses: bazel-contrib/setup-bazel@0.15.0
72+
with:
73+
bazelisk-cache: true
74+
disk-cache: ${{ github.workflow }}
75+
repository-cache: true
6476
- name: Test ${{ matrix.sanitizer }}
6577
run: |
6678
./.github/workflows/configurebb.sh
@@ -71,7 +83,11 @@ jobs:
7183
runs-on: ubuntu-22.04
7284
steps:
7385
- uses: actions/checkout@v4
74-
- uses: bazelbuild/setup-bazelisk@v2
86+
- uses: bazel-contrib/setup-bazel@0.15.0
87+
with:
88+
bazelisk-cache: true
89+
disk-cache: ${{ github.workflow }}
90+
repository-cache: true
7591
- name: Test Coverage
7692
run: |
7793
./.github/workflows/configurebb.sh
@@ -83,12 +99,16 @@ jobs:
8399
strategy:
84100
matrix:
85101
os:
86-
- ubuntu-20.04
102+
- ubuntu-22.04
87103
- macos-11
88104
runs-on: ${{ matrix.os }}
89105
steps:
90106
- uses: actions/checkout@v4
91-
- uses: bazelbuild/setup-bazelisk@v2
107+
- uses: bazel-contrib/setup-bazel@0.15.0
108+
with:
109+
bazelisk-cache: true
110+
disk-cache: ${{ github.workflow }}
111+
repository-cache: true
92112
- name: Test with RBE
93113
run: |
94114
./.github/workflows/configurebb.sh

docs/defs.md

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

examples/tabulate_fortran/BUILD.bazel

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ build_test(
3232
fortran_binary(
3333
name = "tabulate_fortran",
3434
srcs = [
35-
"functions.f90",
3635
"tabulate.f90",
3736
],
37+
modules = {
38+
"functions.f90": "user_functions.mod",
39+
},
3840
)
3941

4042
platform_transition_filegroup(

0 commit comments

Comments
 (0)