Skip to content

Commit

Permalink
chore: update ci
Browse files Browse the repository at this point in the history
GH actions and Elixir/Erlang/Ubuntu
  • Loading branch information
puzza007 committed Apr 5, 2024
1 parent 35faac4 commit 6a22e69
Showing 1 changed file with 42 additions and 42 deletions.
84 changes: 42 additions & 42 deletions .github/workflows/private-elixir-library-w-git-ops.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,173 +3,173 @@ on: push
name: Privately published Elixir Library (with git ops)

env:
ELIXIR_VERSION: "1.9"
OTP_VERSION: "22.2"
ELIXIR_VERSION: "1.12.3"
OTP_VERSION: "24.3.3"

jobs:
deps:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
env:
NARRATIVE_HEX_ORG_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Signing into narrativeapp organisation on hex
run: mix hex.organization auth narrativeapp --key $NARRATIVE_HEX_ORG_API_KEY
- name: Downloading dependency cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: deps
key: ${{ runner.os }}-deps
- run: mix deps.get
- name: Uploading dependencies for other jobs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: deps
path: deps/

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifact cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: _build
key: ${{ runner.os }}-build
- name: Run `mix compile`
run: mix compile
- name: Uploading build artifacts for other jobs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: build
path: _build/

credo:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps", "build"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
- run: mix credo --strict

formatter:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- run: mix format --check-formatted

audit:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps"]
env:
NARRATIVE_HEX_ORG_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- run: mix hex.organization auth narrativeapp --key $NARRATIVE_HEX_ORG_API_KEY
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- run: mix hex.audit

test:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps", "build"]
env:
MIX_ENV: test
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
- run: mix test

is_releasable:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps", "test", "audit", "formatter", "credo"]
if: ${{ github.event_name == 'push' && github.ref != 'refs/heads/master'}}
env:
HEX_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
Expand All @@ -179,41 +179,41 @@ jobs:
- name: Run mix hex.build
run: mix hex.build -o ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
- name: Uploading hex package as job artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
path: ${{ steps.app-info.outputs.app_name }}-${{ steps.app-info.outputs.app_version }}.tar
- name: Run mix docs
run: MIX_ENV=test mix docs && tar zcvf docs.tar.gz doc/
- name: Uploading documentation as job artifact
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ steps.app-info.outputs.app_name }}-docs-${{ steps.app-info.outputs.app_version }}.tar.gz
path: docs.tar.gz

git_ops:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
needs: ["deps", "test", "audit", "formatter", "credo"]
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
env:
HEX_API_KEY: ${{ secrets.NARRATIVE_HEX_ORG_API_KEY }}
steps:
- name: Checking out project
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: "Setting up Elixir"
uses: actions/setup-elixir@v1
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION }}
elixir-version: ${{ env.ELIXIR_VERSION }}
- name: Downloading dependencies
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: deps
path: deps/
- name: Downloading build artifacts
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: build
path: _build/
Expand Down

0 comments on commit 6a22e69

Please sign in to comment.