Commit Graph

23 Commits

Author SHA1 Message Date
Paolo Tranquilli
33b6ce7365 Swift: update formatting to clang-format 17.0.6
Also, added a format check in `swift.yml`.
2024-01-25 13:58:14 +01:00
dependabot[bot]
03771ffad2 Bump actions/checkout from 2 to 4
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-05 12:17:54 +02:00
Paolo Tranquilli
0574f2784f Swift: trigger workflow on codeql-cli-* 2023-05-23 12:32:28 +02:00
Paolo Tranquilli
cdd4e8021b Move swift/codegen to misc/codegen 2023-02-27 09:46:48 +01:00
Paolo Tranquilli
0058bf4443 Swift: add timeout to inetgration tests on macOS 2022-12-08 08:44:29 +01:00
Paolo Tranquilli
52a117aaf5 Swift: optimize bazel caching in CI
Previously the cache would become stale. Now the same incremental
cache mechanism in use for the QL cache is adopted (and factored out
in a separate action).

Namely, pushes on main will populate the cache using the commit hash as
key, while PRs will try to use the cache of their merge base, read-only.

To avoid the cache growing out of control, a simple cache eviction is
done on pushes.
2022-11-29 11:43:54 +01:00
erik-krogh
d2824413db skip the only remaining macos job running on main 2022-11-28 14:44:34 +01:00
Paolo Tranquilli
8df7d465cb Swift: cache more aggressively in CI
* the QL compilation cache action is used for ql and integration tests
* all caches (Bazel and QL) are populated on push
2022-11-25 08:52:46 +01:00
Paolo Tranquilli
2cd58817d7 Swift: skip QL code generation on untouched files
This is a developer QoL improvement, where running codegen will skip
writing (and especially formatting) any files that were not changed.

**Why?** While code generation in itself was pretty much instant, QL
formatting of generated code was starting to take a long time. This made
unconditionally running codegen quite annoying, for example before each
test run as part of an IDE workflow or as part of the pre-commit hook.

**How?** This was not completely straightforward as we could not work
with the contents of the file prior to code generation as that was
already post-processed by the QL formatting, so we had no chance of
comparing the output of template rendering with that. We therefore store
the hashes of the files _prior_ to QL formatting in a checked-in file
(`swift/ql/.generated.list`). We can therefore load those hashes at
the beginning of code generation, use them to compare the template
rendering output and update them in this special registry file.

**What else?** We also extend this mechanism to detect accidental
modification of generated files in a more robust way. Before this patch,
we were doing it with a rough regexp based heuristic. Now, we just store
the hashes of the files _after_ QL formatting in the same checked file,
so we can check that and stop generation if a generated file was
modified, or a stub was modified without removing the `// generated`
header.
2022-11-18 16:56:01 +01:00
Paolo Tranquilli
d4f3e38062 Swift: fix path of generated C++ files artifact 2022-11-16 09:49:57 +01:00
Alex Denisov
b5400f6dc9 Swift: remove rebase artifact 2022-11-14 08:55:44 +01:00
Alex Denisov
d49015a7e6 Swift: infrastructure for upgrade/downgrade scripts 2022-11-11 15:51:23 +01:00
erik-krogh
fbb2dcf7a8 remove langauge specific format checks 2022-11-10 17:47:14 +01:00
Paolo Tranquilli
d325a42890 Swift: print unextracted entities 2022-11-08 15:38:53 +01:00
Paolo Tranquilli
7e0a7d8b71 Swift: fix third-party action commit 2022-11-03 09:20:58 +01:00
Paolo Tranquilli
17012c1a45 Swift: fix workflow job dependencies 2022-11-02 14:35:23 +01:00
Paolo Tranquilli
e6d4685109 Swift: split quick tests in separate action
Also, make the quick test list explicit in the action code, so we can
catch an inadvertant test deletion.
2022-11-02 14:32:45 +01:00
Paolo Tranquilli
57a616262f Swift: fix run cwd 2022-11-02 06:27:09 +01:00
Paolo Tranquilli
0d9ecfc4de Swift: move small bazel tests to build action 2022-11-02 06:23:44 +01:00
Paolo Tranquilli
6e370beb92 Swift: turn on macOS QL tests with slicing 2022-11-02 06:07:55 +01:00
Paolo Tranquilli
59284739dd Swift: reenable ql tests on macos 2022-10-31 17:07:56 +01:00
Paolo Tranquilli
80ea2b8c5e Swift: use macos-12-xl runners 2022-10-31 16:59:11 +01:00
Paolo Tranquilli
003866621f Swift: rework workflows
* A unique workflow file has been created merging all `swift-*.yml`
  workflows
* Change filtering at job level was added using [dorny/paths-filter][1]
* only one build of the extractor is made, and then shared via cache
  (not as an artifact because of [this longstading issue][2])
* integration tests are now run on on macOS
* qltests are not run any more on macOS to cut on feedback time
* autobuilder tests were moved to the macOS build step to avoid loading
  bazel twice

[1]: https://github.com/dorny/paths-filter#examples
[2]: https://github.com/actions/upload-artifact/issues/38
2022-10-31 16:59:11 +01:00