Skip to content

Commit b543b68

Browse files
authored
Update CI (#503)
1 parent 90d068d commit b543b68

16 files changed

+671
-252
lines changed

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: mix
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
open-pull-requests-limit: 10
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: daily
12+
open-pull-requests-limit: 10

.github/workflows/branch_main.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
on:
2+
push:
3+
branches:
4+
- "main"
5+
workflow_dispatch: {}
6+
7+
name: "Main Branch"
8+
9+
# Secrets:
10+
# * CACHE_VERSION - Set to `date +%s`, set new when the cache should be busted
11+
12+
jobs:
13+
detectToolVersions:
14+
name: "Detect Tool Versions"
15+
16+
uses: ./.github/workflows/part_tool_versioning.yml
17+
18+
test:
19+
name: "Test"
20+
21+
needs: ['detectToolVersions']
22+
23+
uses: ./.github/workflows/part_test.yml
24+
with:
25+
elixirVersion: "${{ needs.detectToolVersions.outputs.elixirVersion }}"
26+
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
27+
secrets:
28+
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"
29+
30+
docs:
31+
name: "Docs"
32+
33+
needs: ['detectToolVersions']
34+
35+
uses: ./.github/workflows/part_docs.yml
36+
with:
37+
elixirVersion: "${{ needs.detectToolVersions.outputs.elixirVersion }}"
38+
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
39+
secrets:
40+
CACHE_VERSION: "${{ secrets.CACHE_VERSION }}"

.github/workflows/daily.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
on:
2+
schedule:
3+
# Every Day Midnight
4+
- cron: '0 0 * * *'
5+
workflow_dispatch: {}
6+
7+
name: "Daily"
8+
9+
jobs:
10+
checkAsdfUpdatesElixir:
11+
name: "ASDF Update Elixir"
12+
13+
uses: ./.github/workflows/part_asdf_update.yml
14+
with:
15+
plugin: "elixir"
16+
constraint: "1"
17+
18+
checkAsdfUpdatesErlang:
19+
name: "ASDF Update Erlang"
20+
21+
uses: ./.github/workflows/part_asdf_update.yml
22+
with:
23+
plugin: "erlang"
24+

.github/workflows/elixir.yml

Lines changed: 0 additions & 243 deletions
This file was deleted.
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
plugin:
5+
type: string
6+
required: true
7+
constraint:
8+
type: string
9+
default: ""
10+
required: false
11+
12+
name: "ASDF Update"
13+
14+
jobs:
15+
compile_assets:
16+
name: "${{ inputs.plugin }}"
17+
18+
runs-on: ubuntu-latest
19+
20+
permissions:
21+
contents: write
22+
pull-requests: write
23+
24+
steps:
25+
- uses: actions/checkout@v3
26+
- name: ASDF Install
27+
uses: asdf-vm/actions/install@v1
28+
- name: "Get Newest Version"
29+
id: newestVersion
30+
run: |
31+
LATEST_VERSION=$(asdf latest "${{ inputs.plugin }}" "${{ inputs.constraint }}")
32+
echo "Latest (${{ inputs.constraint }}): $LATEST_VERSION"
33+
echo ::set-output name=LATEST_VERSION::${LATEST_VERSION}
34+
- name: "Try Installing new version"
35+
run: |
36+
asdf install "${{ inputs.plugin }}" "${{ steps.newestVersion.outputs.LATEST_VERSION }}"
37+
- name: "Apply latest version to .tool-versions"
38+
run: |
39+
asdf local "${{ inputs.plugin }}" "${{ steps.newestVersion.outputs.LATEST_VERSION }}"
40+
- uses: peter-evans/create-pull-request@v4
41+
with:
42+
add-paths: '.tool-versions'
43+
commit-message: 'Update ${{ inputs.plugin }} to ${{ steps.newestVersion.outputs.LATEST_VERSION }}'
44+
title: 'Update ${{ inputs.plugin }} to ${{ steps.newestVersion.outputs.LATEST_VERSION }}'
45+
branch: 'asdf/${{ inputs.plugin }}/${{ steps.newestVersion.outputs.LATEST_VERSION }}'
46+
delete-branch: true
47+
labels: 'asdf,enhancement'
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
on:
2+
workflow_call: {}
3+
4+
name: "Dependabot"
5+
6+
jobs:
7+
automerge_dependabot:
8+
name: "Automerge PRs"
9+
10+
runs-on: ubuntu-latest
11+
12+
permissions:
13+
pull-requests: write
14+
contents: write
15+
16+
steps:
17+
- uses: fastify/[email protected]
18+
with:
19+
github-token: ${{ github.token }}
20+
# Major Updates need to be merged manually
21+
target: minor

0 commit comments

Comments
 (0)