forked from bitwalker/libcluster
-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (127 loc) · 4.76 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
name: Elixir CI Checks
env:
SHA: ${{ github.sha }}
JOB_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
DEBIAN_FRONTEND: noninteractive
REPOSITORY: libcluster
ELIXIR_VERSION: 1.13.0 # Elixir version used during package publishing
OTP_VERSION: 23.3.4.7 # OTP version used during package publishing
RUNNER_OS: ubuntu22 # Must match Elixir/OTP version in described in action erlef/setup-beam@v1
RELEVANT_FILES: "mix.lock mix.exs lib config test" # Important, this controls the caching, make sure to keep this right
DEPENDENCY_FILE: mix.lock
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
push:
branches:
- master
pull_request:
types:
- synchronize
- opened
- reopened
jobs:
static:
name: Static Checks (Elixir ${{ matrix.versions.elixir-version }})
runs-on: runs-on,runner=4cpu-linux-x64
outputs:
HASH: ${{ steps.prepare.outputs.HASH }}
strategy:
fail-fast: false
matrix:
versions:
- { elixir-version: 1.16.2, otp-version: 26.2.5, runner-os: 'ubuntu22' }
steps:
- name: Checkout and compile dependencies
id: prepare
uses: surgeventures/platform-tribe-actions/elixir/precompile@main
with:
repository: ${{ env.REPOSITORY }}
dependency-file: ${{ env.DEPENDENCY_FILE }}
sha: ${{ env.SHA }}
token: ${{ secrets.GITHUB_TOKEN }}
hex-token: ${{ secrets.HEX_ORGANIZATION_KEY }}
mix-env: dev
relevant-files: ${{ env.RELEVANT_FILES }}
elixir-version: ${{ matrix.versions.elixir-version }}
otp-version: ${{ matrix.versions.otp-version }}
runner-os: ${{ matrix.versions.runner-os }}
- name: Compile the application
id: compile
uses: surgeventures/platform-tribe-actions/elixir/compile@main
with:
build-hash: ${{ steps.prepare.outputs.HASH }}
warnings-as-errors: 'true'
elixir-version: ${{ matrix.versions.elixir-version }}
otp-version: ${{ matrix.versions.otp-version }}
- name: Run Static Checks
uses: surgeventures/platform-tribe-actions/elixir/static-check@main
id: static
with:
dialyzer: true
hex-token: ${{ secrets.HEX_ORGANIZATION_WRITE_KEY }}
test:
name: Unit Tests (Elixir ${{ matrix.versions.elixir-version }})
runs-on: runs-on,runner=1cpu-linux-x64
strategy:
fail-fast: false
matrix:
versions:
- { elixir-version: 1.16.2, otp-version: 26.2.5, runner-os: 'ubuntu22' }
steps:
- name: Checkout and compile dependencies
id: prepare
uses: surgeventures/platform-tribe-actions/elixir/precompile@main
with:
repository: ${{ env.REPOSITORY }}
dependency-file: ${{ env.DEPENDENCY_FILE }}
sha: ${{ env.SHA }}
token: ${{ secrets.GITHUB_TOKEN }}
hex-token: ${{ secrets.HEX_ORGANIZATION_KEY }}
mix-env: test
relevant-files: ${{ env.RELEVANT_FILES }}
elixir-version: ${{ matrix.versions.elixir-version }}
otp-version: ${{ matrix.versions.otp-version }}
runner-os: ${{ matrix.versions.runner-os }}
- name: Compile the application
id: compile
uses: surgeventures/platform-tribe-actions/elixir/compile@main
with:
build-hash: ${{ steps.prepare.outputs.HASH }}
mix-env: test
elixir-version: ${{ matrix.versions.elixir-version }}
otp-version: ${{ matrix.versions.otp-version }}
- name: Run Unit Tests
uses: surgeventures/platform-tribe-actions/elixir/test@main
id: test
permit:
name: Permit Package Publishing
needs: [static, test]
runs-on: runs-on,runner=1cpu-linux-x64
outputs:
PUBLISH: ${{ steps.permit.outputs.PUBLISH }}
steps:
- name: Verify elibility for publishing the package
uses: surgeventures/platform-tribe-actions/elixir/permit@main
id: permit
with:
repository: ${{ env.REPOSITORY }}
sha: ${{ env.SHA }}
relevant-files: ${{ env.RELEVANT_FILES}}
publish:
name: Publish Hex Package
needs: [permit]
runs-on: runs-on,runner=2cpu-linux-x64
if: needs.permit.outputs.PUBLISH == 'true' && github.event_name == 'push'
steps:
- name: Publish Package
uses: surgeventures/platform-tribe-actions/elixir/publish@main
with:
repository: ${{ env.REPOSITORY }}
sha: ${{ env.SHA }}
token: ${{ secrets.GITHUB_TOKEN }}
hex-token: ${{ secrets.HEX_ORGANIZATION_WRITE_KEY }}
elixir-version: ${{ env.ELIXIR_VERSION }}
otp-version: ${{ env.OTP_VERSION }}
runner-os: ${{ env.RUNNER_OS }}