Build and Deploy #687
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
name: Build and Deploy | |
env: | |
BUILD_OTP_VERSION: '27.1.2' | |
BUILD_ELIXIR_VERSION: '1.17.3' | |
on: | |
push: | |
schedule: | |
- cron: "0 1 * * 1" | |
jobs: | |
test: | |
env: | |
MIX_ENV: test | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: '${{ env.BUILD_OTP_VERSION }}' | |
elixir-version: '${{ env.BUILD_ELIXIR_VERSION }}' | |
- uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- run: mix deps.get | |
- run: mix compile --all-warnings --warning-as-errors | |
- run: mix coveralls | |
quality: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: '${{ env.BUILD_OTP_VERSION }}' | |
elixir-version: '${{ env.BUILD_ELIXIR_VERSION }}' | |
- uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- run: mix deps.get | |
- run: mix hex.audit | |
- run: mix deps.unlock --check-unused | |
- run: mix deps.audit | |
- run: mix format --check-formatted | |
- run: mix compile --all-warnings --warning-as-errors | |
- run: mix sobelow | |
- run: mix credo | |
sarif: | |
runs-on: ubuntu-20.04 | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v2 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: '${{ env.BUILD_OTP_VERSION }}' | |
elixir-version: '${{ env.BUILD_ELIXIR_VERSION }}' | |
- uses: actions/cache@v2 | |
id: mix-cache | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- run: mix deps.get | |
- run: mix compile.machine --format sarif --output sarif.json | |
- uses: github/codeql-action/upload-sarif@v1 | |
with: | |
sarif_file: sarif.json | |
deploy: | |
needs: test | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/master' | |
steps: | |
- uses: actions/checkout@v1 | |
with: | |
ref: master | |
- uses: rhruiz/git-https-push-action@master | |
name: Deploy | |
with: | |
remoteUrl: ${{ secrets.PUSH_REMOTE }} | |
skipHooks: false | |
- run: "curl -o /dev/null -D - -sf https://cege.la/ | grep -q 'location: https://bit.ly'" | |
name: verify deploy | |