mirror of
https://github.com/outbackdingo/firezone.git
synced 2026-03-21 23:41:58 +00:00
* fix: disallow netmasks in devices' ip to prevent overlaps in firewall /32 is still allowed for ipv4 and /128 is still allowed for ipv6. No migration is needed since netmasks for devices ips were broken before-hand. * chore: rename `validate_single_ip` function and reword its error message * Update pre-commit to allow slash * fix restore cache * Refactor a bit * Fix clobbered restore-keys * Break cache Co-authored-by: Jamil Bou Kheir <jamilbk@users.noreply.github.com>
81 lines
2.7 KiB
YAML
81 lines
2.7 KiB
YAML
name: Static Analysis
|
|
on: [pull_request]
|
|
|
|
jobs:
|
|
static-analysis:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
MIX_ENV: dev
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: actions/setup-node@v3
|
|
with:
|
|
node-version: '16'
|
|
cache: 'npm'
|
|
cache-dependency-path: '**/package-lock.json'
|
|
- uses: ruby/setup-ruby@v1
|
|
with:
|
|
ruby-version: '2.7'
|
|
- uses: actions/setup-python@v2
|
|
with:
|
|
python-version: '3.9'
|
|
- uses: erlef/setup-beam@v1
|
|
with:
|
|
otp-version: '25'
|
|
elixir-version: '1.14'
|
|
- uses: actions/cache@v3.0.11
|
|
name: Setup Elixir cache
|
|
with:
|
|
path: |
|
|
deps
|
|
_build
|
|
key: ${{ runner.os }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-mix-otp-25-${{ hashFiles('**/mix.lock') }}
|
|
- uses: actions/cache@v3.0.11
|
|
name: Setup ruby cache
|
|
with:
|
|
path: vendor/bundle
|
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gems-
|
|
- uses: actions/cache@v3.0.11
|
|
name: Setup Python cache
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
- name: Install Elixir Dependencies
|
|
run: mix deps.get --only $MIX_ENV
|
|
- name: Install Ruby Dependencies
|
|
run: |
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
- name: Install Python Dependencies
|
|
run: |
|
|
pip install -r requirements.txt
|
|
# Don't cache PLTs based on mix.lock hash, as Dialyzer can incrementally update even old ones
|
|
# Cache key based on Elixir & Erlang version (also useful when running in matrix)
|
|
- name: Restore PLT cache
|
|
uses: actions/cache@v3.0.11
|
|
id: plt_cache
|
|
with:
|
|
key: |
|
|
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
|
|
restore-keys: |
|
|
${{ runner.os }}-${{ steps.beam.outputs.elixir-version }}-${{ steps.beam.outputs.otp-version }}-plt
|
|
path: |
|
|
priv/plts
|
|
# Create PLTs if no cache was found
|
|
- name: Create PLTs
|
|
if: steps.plt_cache.outputs.cache-hit != 'true'
|
|
run: mix dialyzer --plt
|
|
- name: Install node modules
|
|
run: npm ci --prefix docs/
|
|
- name: Run pre-commit
|
|
run: |
|
|
pre-commit install
|
|
SKIP=no-commit-to-branch pre-commit run --all-files
|