Commit Graph

39 Commits

Author SHA1 Message Date
Ehren Kret
a1c0e7751c try out larger macos runner 2024-03-01 18:45:02 -06:00
Max Radermacher
9a5eb2d478
Upgrade checkout action to v4 2024-02-01 13:57:24 -06:00
Max Radermacher
09d38fcf68 Update to Xcode 14.2 2023-03-22 16:34:51 -07:00
Max Radermacher
dee5aed385 Clean up directories we search for translations 2023-02-23 10:37:57 -08:00
Max Radermacher
036a878774 Cancel old GitHub Actions when updating a PR 2022-10-21 10:39:08 -07:00
Evan Hahn
370ff654e7
Change license to AGPL
Change license to AGPL

This commit:

- Updates the `LICENSE` file

- Start every file with something like:

      // Copyright YEAR_FIRST_PUBLISHED Signal Messenger, LLC
      // SPDX-License-Identifier: AGPL-3.0-only

---

First, I removed existing license headers with this Ruby 3.1.2 script:

    require 'set'

    EXTENSIONS_TO_CHECK = Set['.h', '.hpp', '.cpp', '.m', '.mm', '.pch', '.swift']

    same = 0
    different = 0

    all_files = `git ls-files`.lines.map { |line| line.strip }
    all_files.each do |relative_path|
      if relative_path == 'Pods'
        next
      end

      unless EXTENSIONS_TO_CHECK.include? File.extname(relative_path)
        next
      end

      path = File.expand_path(relative_path)

      contents = File.read(path)
      new_contents = contents.sub(/\/\/\n\/\/  Copyright .*\n\/\/\n\n/, '')

      if contents == new_contents
        same += 1
      else
        different += 1
      end

      File.write(path, new_contents)
    end

    puts "updated #{different} file(s), left #{same} untouched"

I'm sure this script could be improved, but it worked well enough.

Then, I created `Scripts/lint/lint-license-headers` and ran it to auto-
fix a lot of files. This changed the mode of some files, but I think
that's actually desirable. For example,
`SignalServiceKit/src/Util/AppContext.m` previously had a mode of
`0755/-rwxr-xr-x`, and it's now `0644/-rw-r--r--`.

Then I fixed some stragglers and updated the precommit script.

See [a similar change in the Desktop app][0].

[0]: 8bfaf598af
2022-10-13 08:25:37 -05:00
Max Radermacher
cc0e45c895 Set a per-test timeout of 60 seconds on CI 2022-09-26 14:19:43 -07:00
Max Radermacher
fa5960d4ef Don’t resolve SPM dependencies in CI 2022-09-26 12:43:01 -07:00
Max Radermacher
b8ab27efc9 Add more retries for -showBuildSettings on CI 2022-09-26 11:38:21 -07:00
Max Radermacher
13e57aad9a Use setup-ruby’s bundler-cache option
The [docs][0] recommend this instead of manually caching the artifacts.

[0]: https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby#caching-bundle-install-automatically
2022-09-23 13:12:37 -07:00
Max Radermacher
6a5bc7ce68 Update CI to Xcode 14
- Use Xcode 14 for all of our jobs. If something like `genstrings`
  changes, this should keep that job consistent with everything else.

- Use macos-12 for all of our jobs. It’s probably best to keep things
  consistent, and macos-11 will eventually go away.
2022-09-22 11:00:34 -07:00
Evan Hahn
3260739678 Double autogenstrings CI timeout 2022-09-20 10:29:18 -07:00
Max Radermacher
a0e749b1d5 Set explicit timeouts for GitHub workflows 2022-09-13 16:49:41 -07:00
Max Radermacher
690a9f0a47
Show precommit.py diff in GitHub Action 2022-08-31 16:53:02 -05:00
Evan Hahn
bac5b0555b Revert "CI: make bigger check depend on lighter check"
This reverts commit 1e2422b6ba, because it
caused CI to be *entirely* skipped in some cases.
2022-07-27 15:04:23 -05:00
Evan Hahn
30315a9c63
Check if strings are up to date in CI
A few of us (myself included) have forgotten to run `auto-genstrings`
and they've gotten out of date on the main branch.

This adds a simple CI job to catch these.
2022-07-25 08:17:41 -05:00
Evan Hahn
1e2422b6ba CI: make bigger check depend on lighter check
This will save Signal some money if lint fails (which is fairly common)
and add ~30 seconds if lint succeeds.
2022-07-20 08:47:35 -05:00
Evan Hahn
cb387bc031 Explicitly require Xcode 13.2
Instead of it being a minimum version.
2022-07-06 14:59:33 -05:00
Evan Hahn
80369c8cdd Update to macOS 12 on CI
See [the documentation][0] for this macOS version.

[0]: https://github.com/actions/virtual-environments/blob/main/images/macos/macos-12-Readme.md
2022-07-06 14:59:33 -05:00
Frazer Smith
7e7f6caf2c Update GitHub Actions
See [#5382][0].

[0]: https://github.com/signalapp/Signal-iOS/pull/5382
2022-06-17 05:20:42 -05:00
Nora Trapp
7edb8c5038
master -> main 2022-04-29 14:21:08 -07:00
Evan Hahn
84ebba40a2 CI: only run precommit script for pull requests
According to [GitHub's docs][0], the `github.base_ref` property "is only
available when the event that triggers a workflow run is either
`pull_request` or `pull_request_target`.

Because of this, pushes were running the following command...

    python3 Scripts/precommit.py --ref origin/

...and getting this error:

    fatal: ambiguous argument 'origin/': unknown revision or path not in the working tree.

This has been broken for a long time, but it didn't cause CI to fail until
d7c33eb211.

After some discussion, we decided not to run these on pushes to `master`
or `release/*`.

(See also: [this GitHub issue][1] which asks for clarification.)

[0]: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context
[1]: https://github.com/github/docs/issues/13810
2022-04-04 09:57:24 -05:00
Jordan Rose
7ca12f9885 CI: Remove Rust install step
LibSignalClient is no longer compiled on demand, so we don't need Rust
to build and test the iOS app.
2022-03-29 10:17:30 -07:00
Chris Eager
113c293232 Update rust working directory in GitHub Action 2022-03-28 13:19:38 -07:00
Evan Hahn
1101db6a29 Upgrade scripts to Python 3
Python 2 was [removed from macOS in 12.3][0]. This change:

- Automatically converts many files with [2to3][1]
- Manually updates all [shebangs][2] to use `python3` instead of
  versionless `python` or `python2.7`
- Manually applies a few fixes, many of which were noted by 2to3
- Manually undoes a few fixes that were automatically done by 2to3

[0]: https://www.macrumors.com/2022/01/28/apple-removing-python-2-in-macos-12-3/
[1]: https://docs.python.org/3/library/2to3.html
[2]: https://en.wikipedia.org/wiki/Shebang_(Unix)
2022-03-21 12:58:33 -05:00
Jordan Rose
5a050b914c CI: Upload build logs on failure 2022-02-02 16:06:38 -08:00
Jordan Rose
363da96482 CI: Check out submodules through GitHub, which is faster 2022-01-27 15:56:56 -08:00
Michelle Linington
3b6fa704f1 Three part version numbers need lexicographic ordering 2021-10-04 09:53:36 -03:00
Michelle Linington
686375c447 Add CI phase to select a minimum Xcode version
This change uses a throwing computed variable which was added in Swift
5.5 and requires Xcode 13 to compile.

The default Xcode on current macOS 11 image is still 12.5.1 and won't be
updated until later this month. The newer Xcode is available on these
machines, but until October 18th we need to select it manually.
https://github.com/actions/virtual-environments/issues/4180
2021-10-04 09:53:36 -03:00
Nora Trapp
7361da63d1 Fix github actions 2021-08-18 16:40:05 -07:00
Ewout ter Hoeven
5af19751d7 CI: Use ruby/setup-ruby step with .ruby-version
- Replaces the actions/setup-ruby step, which is deprecated, with the ruby/setup-ruby step
 - Uses the Ruby version from the .ruby-version file
2021-08-18 15:28:54 -07:00
Nora Trapp
e0d3d455bf Update CI to macOS 11 2021-06-16 11:36:09 -07:00
Ewout ter Hoeven
24a7dc7755 CI: Run on pushes to master and release branches 2021-02-12 12:12:27 -08:00
Nora Trapp
4566549c21 Don't install swiftlint, it's built in now 2021-02-12 12:12:27 -08:00
Jordan Rose
65da248b06 GitHub: install iOS target for Rust (using the correct toolchain) 2021-01-28 12:03:49 -08:00
Jordan Rose
944e44c074 GitHub: Speed up checking out a repository when linting
We only need two commits: the merge commit and the base ref.
2020-10-23 16:01:18 -07:00
Jordan Rose
a96afb8d33 GitHub: Clarify linting error to refer to precommit.py
...instead of just clang-format, since precommit.py does other linting
as well.
2020-09-30 11:32:17 -07:00
Nora Trapp
f05f2ff85f Add lint action 2020-03-14 15:40:02 -07:00
Nora Trapp
96d7b843b5 Github CI test 2020-03-14 15:40:02 -07:00