Prepare release v0.13.1 #563
Workflow file for this run
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: StellarBase CI | |
on: | |
push: | |
branches: | |
- main | |
- 'v*.[0-9]' | |
pull_request: | |
permissions: | |
contents: read | |
jobs: | |
tests: | |
name: Run tests | |
runs-on: ubuntu-20.04 | |
strategy: | |
matrix: | |
otp: ['22.3', '23.3'] | |
elixir: ['1.10', '1.11'] | |
env: | |
MIX_ENV: test | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
coveralls.io:443 | |
github.com:443 | |
repo.hex.pm:443 | |
builds.hex.pm:443 | |
- name: Checkout Github repo | |
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2 | |
- name: Sets up an Erlang/OTP environment | |
uses: erlef/setup-elixir@c2e02f777c158310fc6d3d4e11b36a52d2d52db8 # v1.15.4 | |
with: | |
otp-version: ${{ matrix.otp }} | |
elixir-version: ${{ matrix.elixir }} | |
- name: Set mix file hash | |
id: set_vars | |
run: | | |
mix_hash="${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}" | |
echo "::set-output name=mix_hash::$mix_hash" | |
- name: Cache dependecies | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: deps | |
key: ${{ runner.os }}-mix-${{ steps.set_vars.outputs.mix_hash }} | |
restore-keys: | | |
${{ runner.os }}-mix- | |
- name: Cache PLT files | |
id: plt-cache | |
uses: actions/cache@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1 | |
with: | |
path: | | |
_build | |
priv/plts | |
key: plt-cache-${{ steps.set_vars.outputs.mix_hash }} | |
restore-keys: | | |
plt-cache- | |
- name: Install dependencies | |
run: mix deps.get | |
- name: Check formatting | |
run: mix format --check-formatted | |
- name: Run tests | |
run: mix test | |
- name: Run credo | |
run: mix credo --strict | |
- name: Run dialyzer | |
run: mix dialyzer --no-check --ignore-exit-status | |
- name: Run excoveralls | |
run: mix coveralls.github --parallel --flagname otp-${{ matrix.otp }}-elixir-${{ matrix.elixir }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
finish: | |
needs: tests | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Harden Runner | |
uses: step-security/harden-runner@128a63446a954579617e875aaab7d2978154e969 # v2.4.0 | |
with: | |
disable-sudo: true | |
egress-policy: block | |
allowed-endpoints: > | |
coveralls.io:443 | |
- name: Set BUILD_NUMBER for Pull Request event | |
if: github.event_name == 'pull_request' | |
run: echo "BUILD_NUMBER=${{ github.event.pull_request.head.sha }}-PR-${{ github.event.pull_request.number }}" >> $GITHUB_ENV | |
- name: Set BUILD_NUMBER for Push event | |
if: github.event_name == 'push' | |
run: echo "BUILD_NUMBER=${{ github.sha }}" >> $GITHUB_ENV | |
- name: Publish Coverage Report | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
BUILD_NUMBER: ${{ env.BUILD_NUMBER }} | |
run: | | |
curl -k "https://coveralls.io/webhook" -d "repo_token=$GITHUB_TOKEN&repo_name=$GITHUB_REPOSITORY&payload[build_num]=$BUILD_NUMBER&payload[status]=done" |