Skip to content

Commit

Permalink
Updates CI/CD and update_version script
Browse files Browse the repository at this point in the history
  • Loading branch information
GPrimola committed Feb 16, 2024
1 parent 9dae812 commit f3bd020
Show file tree
Hide file tree
Showing 6 changed files with 95 additions and 86 deletions.
47 changes: 27 additions & 20 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
name: Jenkiexs CD
name: Deploy Jenkiexs

on:
workflow_run:
workflows: ["Jenkiexs Master CI"]
workflows: ["Main CI"]
types:
- completed


jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -26,6 +26,7 @@ jobs:
deps
doc
mix.exs
mix.lock
key: ${{ runner.os }}-mix-prod-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-prod-
Expand All @@ -50,16 +51,17 @@ jobs:
run: mix docs

check_package:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -68,6 +70,7 @@ jobs:
deps
doc
mix.exs
mix.lock
key: ${{ runner.os }}-mix-prod-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-prod-
Expand All @@ -77,16 +80,17 @@ jobs:
run: mix hex.publish --dry-run

publish_package:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: check_package

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -95,6 +99,7 @@ jobs:
deps
doc
mix.exs
mix.lock
key: ${{ runner.os }}-mix-prod-${{ hashFiles(format('{0}{1}', github.workspace, '/mix.lock')) }}
restore-keys: |
${{ runner.os }}-mix-prod-
Expand All @@ -105,18 +110,20 @@ jobs:


update_version:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: publish_package

permissions:
contents: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Update README.md and mix.exs
run: |
elixir ./scripts/update_version.exs
Expand Down
44 changes: 25 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,23 @@
name: Jenkiexs CI

on: [ push, pull_request ]
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.9.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -37,16 +42,17 @@ jobs:
run: mix compile

lint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.9.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -62,16 +68,17 @@ jobs:
run: mix format --check-formatted

test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.9.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -85,21 +92,20 @@ jobs:
- run: mix test

coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: test

env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.9.x'
otp-version: '22.3'

elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand Down
43 changes: 22 additions & 21 deletions .github/workflows/master-ci.yml → .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Jenkiexs Master CI
name: Main CI

on:
push:
Expand All @@ -7,15 +7,16 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -40,16 +41,17 @@ jobs:
run: mix compile

lint:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -65,16 +67,17 @@ jobs:
run: mix format --check-formatted

test:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: build

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.8.x'
otp-version: '22.3'
elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -88,21 +91,20 @@ jobs:
- run: mix test

coverage:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: test

env:
MIX_ENV: test
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v2

- uses: actions/checkout@v3
- name: Set up Elixir
uses: erlef/setup-beam@v1
with:
elixir-version: '1.9.x'
otp-version: '22.3'

elixir-version: '1.8.2'
otp-version: '22.3.4.26'
version-type: 'strict'
- name: Cache Dependencies
uses: actions/cache@v2
with:
Expand All @@ -124,9 +126,8 @@ jobs:


trigger-cd:
runs-on: ubuntu-latest
runs-on: ubuntu-20.04
needs: coverage

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_ACTIONS_USER }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ defmodule Jenkiexs.MixProject do
version: @version,
elixir: "~> 1.8",
start_permanent: Mix.env() == :prod,
description: "Jenkins client written in Elixir",
description: "Jenkins API client written in Elixir",
package: package(),
deps: deps(),
docs: docs(),
Expand Down
Loading

0 comments on commit f3bd020

Please sign in to comment.