Skip to content

Commit

Permalink
Merge pull request #167 from revelrylabs/245-github-actions-migrate
Browse files Browse the repository at this point in the history
Migration to GitHub Actions
  • Loading branch information
Samkeer1 authored Apr 5, 2024
2 parents e3b5524 + 68893bb commit e5f4fba
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 21 deletions.
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

on:
push:
tags: [ 'v*.*.*' ]
branches: master

env:
OTP_VERSION_SPEC: "21.1"
ELIXIR_VERSION_SPEC: "1.9.4"

jobs:
test:
uses: ./.github/workflows/test.yml
publish:
needs: test
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}

# https://hex.pm/docs/publish
- name: Publish
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: |
mix deps.get
mix hex.publish --yes
43 changes: 43 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test

on: [push, workflow_call]

env:
OTP_VERSION_SPEC: "21.1"
ELIXIR_VERSION_SPEC: "1.9.4"
MIX_ENV: test
PGUSER: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_PORT: 5432

jobs:
test:
runs-on: ubuntu-20.04
services:
postgres:
env:
POSTGRES_HOST_AUTH_METHOD: trust
image: postgres:9.5
ports:
- 5432:5432
options: >-
--health-cmd pg_isready --health-interval 10s
--health-timeout 5s --health-retries 5
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.OTP_VERSION_SPEC }}
elixir-version: ${{ env.ELIXIR_VERSION_SPEC }}

- name: Run Tests
run: |
mix deps.get
cp config/test.exs.GH_actions config/test.exs
mix ecto.create
mix test
21 changes: 0 additions & 21 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions config/test.exs.travis → config/test.exs.GH_actions
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config :ecto_soft_delete, Ecto.SoftDelete.Test.Repo,
database: "soft_delete_test",
hostname: "localhost",
port: 5432,
username: "postgres",
adapter: Ecto.Adapters.Postgres,
pool: Ecto.Adapters.SQL.Sandbox,
types: EctoSoftDelete.PostgresTypes

1 comment on commit e5f4fba

@Samkeer1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Github Action is failing due to a lack of version upgrade. Hexpm sees us pushing a change to an older version outside of the allowed update window (1 hour after publish). It doesn't necessarily mean this action is failing, but indicates a failing hex publish.

Please sign in to comment.