Skip to content

Commit

Permalink
feat(CI): switch from travis to GH actions (#12)
Browse files Browse the repository at this point in the history
* feat(CI): add rudimentary GH actions workflow

* dump github context

* fix indent

* split test and publish workflows

* use branch ref for tags

* do not run tests.yml for tags, also test 1.6 in publish.yml

* quote branch match in tests.yml

* empty commit

* non empty commit

* back to single file, if: all the release steps

* maybe that will properly match

* maybe that will properly match the second

* maybe that

* now releases

* verify this actually tries to match

* test

* chore: delete .travis.yml

* run tests on pull_requests also, publish only on tags

* publish.yml: match on branches `refs/tags/*`

* don't run tests.yml for tags

* match everything

* match master

* match feat/ci

* remove others

* fully qualify ref

* fully qualify ref the second

* infinite depth

* everything infinite depth

* remove

* star

* two stars

* emtpy

* when in doubt, add more stars

* skip tags

* remove tags clause

* refspec

* everything except tags, again

* another star

* double the stars and add a slash

* try hardcoding branch prefixes

* tags? no such thing here

* commit

* tags

* remove job level ifs add dry run to hex script

* remove prod env

* provide key

* fix spelling of 'secrets'

* arm publish workflow

* add eol
  • Loading branch information
SpaceEEC committed Sep 3, 2019
1 parent a23cdee commit d95d816
Show file tree
Hide file tree
Showing 4 changed files with 129 additions and 30 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: Publish

on:
push:
tags:
- '*'
- '*/**'
- '**/**'

jobs:
# Redundant but can't be helped AFAIK
test-elixir-min-version:
name: Elixir 1.6 - Only Tests

runs-on: ubuntu-latest

container:
image: spaceeec/elixir:1.6-slim

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Tests
run: mix test

test-elixir-latest:
name: Elixir 1.9 - Full

runs-on: ubuntu-latest

container:
image: spaceeec/elixir:1.9-slim

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Formatting
run: mix format --check-formatted
- name: Credo
run: mix credo --strict
- name: Tests
run: mix test

release:
name: Publish

needs: [test-elixir-latest, test-elixir-min-version]

runs-on: ubuntu-latest

container:
image: spaceeec/elixir:1.9-slim

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Compile
run: mix compile
- name: Publish
env:
HEX_API_KEY: ${{ secrets.HEX_API_KEY }}
run: mix hex.publish --yes
55 changes: 55 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Tests

on:
push:
branches:
- '*'
- 'feat/*'
- 'docs/*'
- 'fix/*'
- 'refactor/*'
tags:
- '!*'
- '!*/**'
- '!**/**'

jobs:
test-elixir-min-version:
name: Elixir 1.6 - Only Tests

runs-on: ubuntu-latest

container:
image: spaceeec/elixir:1.6-slim

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Tests
run: mix test

test-elixir-latest:
name: Elixir 1.9 - Full

runs-on: ubuntu-latest

container:
image: spaceeec/elixir:1.9-slim

steps:
- uses: actions/checkout@v1
- name: Install Dependencies
run: |
mix local.rebar --force
mix local.hex --force
mix deps.get
- name: Formatting
run: mix format --check-formatted
- name: Credo
run: mix credo --strict
- name: Tests
run: mix test
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

5 changes: 0 additions & 5 deletions deploy/deploy.sh

This file was deleted.

0 comments on commit d95d816

Please sign in to comment.