Files
firezone/.github/workflows/static-analysis.yml
Thomas Eizinger 5549044afe ci: use sccache for Rust (#2402)
Our caches in GitHub actions are hopelessly overflowing, plus for the
Kotlin and Swift jobs, we don't seem to be doing a particularly good job
at caching the build outputs because those jobs take forever.

Instead of using GitHub actions, this PR configures `sccache` for all
Rust compilation commands and uses a GCP bucket to store the artifacts.
This speeds up some of the builds a fair bit. Android now finishes in
~6minutes.

Apart from the self-hosted MacOS 14 runner, the Swift jobs are slow but
still a lot faster than what we currently have.

Windows seems to be quite slow at compiling / fetching artefacts which
is negatively impacted by this change because they now have to be
fetched from the bucket.

Overall, I think this is a net-positive though and should be much easier
to maintain going forward.

---------

Co-authored-by: Jamil <jamilbk@users.noreply.github.com>
2023-10-18 10:25:31 -07:00

49 lines
1.4 KiB
YAML

name: Static Analysis
on:
workflow_call:
jobs:
version-check:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check version is up to date
run: |
make version
if [ -z "$(git status --porcelain)" ]; then
# Working directory clean
echo "Version manifests up to date"
else
# Uncommitted changes
echo '`make version` found outdated files! Showing diff'
git diff
exit 1
fi
global-linter:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: "3.9"
- uses: actions/cache/restore@v3
name: Restore Python Cache
with:
path: ~/.cache/pip
key: ubuntu-22.04-${{ runner.arch }}-pip-${{ hashFiles('requirements.txt') }}
restore-keys: |
ubuntu-22.04-${{ runner.arch }}-pip-
- name: Install Python Dependencies
run: |
pip install -r requirements.txt
- name: Run pre-commit
run: |
pre-commit install
SKIP=no-commit-to-branch pre-commit run --all-files
- uses: actions/cache/save@v3
if: ${{ github.ref == 'refs/heads/main' }}
name: Save Python Cache
with:
path: ~/.cache/pip
key: ubuntu-22.04-${{ runner.arch }}-pip-${{ hashFiles('requirements.txt') }}