-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
205 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
# Created with GitHubActions version 0.2.16 | ||
name: Coveralls Report | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }} | ||
on: | ||
- pull_request | ||
- push | ||
jobs: | ||
linux: | ||
name: Test on Ubuntu (Elixir ${{ matrix.elixir }}, OTP ${{ matrix.otp }}) | ||
runs-on: ubuntu-20.04 | ||
services: | ||
# Label used to access the service container | ||
strategy: | ||
matrix: | ||
elixir: | ||
- '1.15.6' | ||
otp: | ||
- '26.1' | ||
exclude: | ||
- elixir: '1.13.4' | ||
otp: '26.1' | ||
- elixir: '1.14.5' | ||
otp: '22.3' | ||
- elixir: '1.14.5' | ||
otp: '26.1' | ||
- elixir: '1.15.6' | ||
otp: '22.3' | ||
- elixir: '1.15.6' | ||
otp: '23.3' | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Setup Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
elixir-version: ${{ matrix.elixir }} | ||
otp-version: ${{ matrix.otp }} | ||
- name: Restore deps | ||
uses: actions/cache@v3 | ||
with: | ||
path: deps | ||
key: deps-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | ||
- name: Restore _build | ||
uses: actions/cache@v3 | ||
with: | ||
path: _build | ||
key: _build-${{ runner.os }}-${{ matrix.elixir }}-${{ matrix.otp }}-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | ||
- name: Get dependencies | ||
run: mix deps.get | ||
- name: Compile dependencies | ||
run: MIX_ENV=test mix deps.compile | ||
- name: Compile project | ||
run: MIX_ENV=test mix compile | ||
- name: Check code format | ||
if: ${{ contains(matrix.elixir, '1.15.6') && contains(matrix.otp, '26.1') }} | ||
run: mix format --check-formatted | ||
- name: Run tests | ||
run: MIX_ENV=test mix test | ||
if: ${{ !(contains(matrix.elixir, '1.15.6') && contains(matrix.otp, '26.1')) }} | ||
- name: Run tests with coverage | ||
run: MIX_ENV=test mix coveralls.github | ||
if: ${{ contains(matrix.elixir, '1.15.6') && contains(matrix.otp, '26.1') }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: "Increment Product Version" | ||
on: | ||
workflow_dispatch: | ||
|
||
push: | ||
branches: | ||
- master | ||
jobs: | ||
Increment-Version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Bump version and push tag | ||
uses: anothrNick/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
WITH_V: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: Execute Vulnerability Scan | ||
on: | ||
workflow_dispatch: | ||
schedule: | ||
- cron: "0 12 * * 5" | ||
|
||
env: | ||
ELIXIR_VERSION: "1.15" | ||
OTP_VERSION: "24.2.1" | ||
APPLICATION_WORKING_DIR: ./ | ||
|
||
jobs: | ||
execute_scan: | ||
name: Execute Vulnerability Scan | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Github Repo | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup Elixir | ||
uses: erlef/setup-beam@v1 | ||
with: | ||
otp-version: ${{ env.OTP_VERSION }} | ||
elixir-version: ${{ env.ELIXIR_VERSION }} | ||
|
||
- name: Setup Dependencies Cache | ||
id: deps-cache | ||
run: | | ||
echo "key=${{ runner.os }}-Elixir(${{ env.OTP_VERSION }})-OTP(${{ env.ELIXIR_VERSION }})-Mix.LockHash(${{ hashFiles('**/mix.lock') }})" >> $GITHUB_OUTPUT | ||
- name: Retrieve Cached Dependencies | ||
uses: actions/cache@v3 | ||
id: mix-cache | ||
with: | ||
path: | | ||
${{env.APPLICATION_WORKING_DIR}}/deps | ||
${{env.APPLICATION_WORKING_DIR}}/_build | ||
key: ${{ steps.deps-cache.outputs.key }} | ||
|
||
- name: Install Dependencies | ||
if: steps.mix-cache.outputs.cache-hit != 'true' | ||
working-directory: ${{env.APPLICATION_WORKING_DIR}} | ||
run: | | ||
mix local.rebar --force | ||
mix local.hex --force | ||
mix deps.get | ||
mix deps.compile | ||
- name: Execute Report | ||
id: report_status | ||
working-directory: ${{env.APPLICATION_WORKING_DIR}} | ||
run: | | ||
mix deps.audit | ||
- name: Echo Scan Exit Code | ||
if: always() | ||
run: echo "${{steps.report_status.outcome}}" | ||
|
||
- name: Vulnerabilities Found - Discord notification | ||
if: always() && steps.report_status.outcome == 'failure' | ||
uses: sarisia/actions-status-discord@v1 | ||
with: | ||
webhook: ${{ secrets.DISCORD_WEBHOOK }} | ||
status: 'failure' | ||
username: GitHub Actions | ||
avatar_url: ${{ secrets.DISCORD_AVATAR_URL }} | ||
title: " Vulnerability Audit" | ||
description: "View Scan Results: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" | ||
image: ${{ secrets.DISCORD_EMBED_IMAGE }} | ||
color: 0x0000ff | ||
url: ${{ github.server_url }}/${{ github.repository }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"skip_files": [ | ||
"deps", | ||
"config" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.