Skip to content

Commit

Permalink
V3 WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
maennchen committed Sep 8, 2023
1 parent afa7786 commit da02cfc
Show file tree
Hide file tree
Showing 98 changed files with 5,672 additions and 5,383 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Required for rebar3_format / new language features
ERL_AFLAGS="-enable-feature all"
3 changes: 3 additions & 0 deletions .formatter.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[
inputs: ["conformance/**/*.{ex,exs}"]
]
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
34 changes: 34 additions & 0 deletions .github/workflows/branch_main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
on:
push:
branches:
- "main"
# TODO: Remove when released
- "v3"

name: "Main Branch"

jobs:
detectToolVersions:
name: "Detect Tool Versions"

uses: ./.github/workflows/part_tool_versioning.yml

test:
name: "Test"

needs: ["detectToolVersions"]

uses: ./.github/workflows/part_test.yml
with:
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
rebarVersion: "${{ needs.detectToolVersions.outputs.rebarVersion }}"

docs:
name: "Docs"

needs: ["detectToolVersions"]

uses: ./.github/workflows/part_docs.yml
with:
otpVersion: "${{ needs.detectToolVersions.outputs.otpVersion }}"
rebarVersion: "${{ needs.detectToolVersions.outputs.rebarVersion }}"
66 changes: 66 additions & 0 deletions .github/workflows/part_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
on:
workflow_call:
inputs:
otpVersion:
required: true
type: string
rebarVersion:
required: true
type: string
releaseName:
required: false
type: string

name: "Documentation"

jobs:
generate:
name: "Generate"

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-elixir@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: docs-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
docs-{{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 ex_doc
- uses: actions/upload-artifact@v3
with:
name: docs
path: doc

upload:
name: "Upload"

runs-on: ubuntu-latest

if: ${{ inputs.releaseName }}

needs: ["generate"]

permissions:
contents: write

steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: docs
path: docs
- run: |
tar -czvf docs.tar.gz docs
- name: Upload
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release upload --clobber "${{ inputs.releaseName }}" \
docs.tar.gz
56 changes: 56 additions & 0 deletions .github/workflows/part_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
on:
workflow_call:
inputs:
releaseName:
required: true
type: string
stable:
required: false
type: boolean
default: false

name: "Release"

jobs:
create_prerelease:
name: Create Prerelease

if: ${{ !inputs.stable }}

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Create draft prerelease
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create \
--repo ${{ github.repository }} \
--title ${{ inputs.releaseName }} \
--prerelease \
--generate-notes \
${{ inputs.releaseName }}
create_stable:
name: Create Stable

if: ${{ inputs.stable }}

runs-on: ubuntu-latest

permissions:
contents: write

steps:
- name: Create draft release
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
gh release create \
--repo ${{ github.repository }} \
--title ${{ inputs.releaseName }} \
--generate-notes \
${{ inputs.releaseName }}
220 changes: 220 additions & 0 deletions .github/workflows/part_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
on:
workflow_call:
inputs:
otpVersion:
required: true
type: string
rebarVersion:
required: true
type: string

name: "Test"

env:
ERL_AFLAGS: "-enable-feature all"

jobs:
format:
name: Check Formatting

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: format-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
format-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 fmt --check

eunit:
name: Run EUnit

runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- otp: "${{ inputs.otpVersion }}"
- otp: "master"

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ matrix.otp }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: eunit-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
eunit-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 eunit --cover
- uses: actions/upload-artifact@v3
with:
name: eunit-coverage
path: _build/test/cover/eunit.coverdata

conformance:
name: Run Conformance Tests

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: ct-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
ct-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 ct --cover
- uses: actions/upload-artifact@v3
with:
name: ct-coverage
path: _build/test/cover/ct.coverdata

coverage:
name: Process Test Coverage

runs-on: ubuntu-latest

needs: ["eunit", "conformance"]

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: cover-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
cover-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- uses: actions/download-artifact@v3
with:
name: ct-coverage
path: _build/test/cover/
- uses: actions/download-artifact@v3
with:
name: eunit-coverage
path: _build/test/cover/
- run: rebar3 cover
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: _build/test/cover/

coveralls:
name: Send Coverage to coveralls.io

runs-on: ubuntu-latest

needs: ["eunit", "conformance"]

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: cover-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
cover-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- uses: actions/download-artifact@v3
with:
name: ct-coverage
path: _build/test/cover/
- uses: actions/download-artifact@v3
with:
name: eunit-coverage
path: _build/test/cover/
- uses: actions/upload-artifact@v3
with:
name: coverage-report
path: _build/test/cover/
- run: rebar3 as test coveralls send
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lint:
name: Lint

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: lint-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
lint-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 lint

dialyzer:
name: Dialyzer

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: dialyzer-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
dialyzer-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 dialyzer

hank:
name: Hank

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: erlef/setup-beam@v1
id: setupBEAM
with:
otp-version: ${{ inputs.otpVersion }}
rebar3-version: ${{ inputs.rebarVersion }}
- uses: actions/cache@v3
with:
path: _build
key: hank-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-${{ hashFiles('rebar.lock') }}
restore-keys: |
hank-${{ runner.os }}-${{ steps.setupBEAM.outputs.otp-version }}-
- run: rebar3 hank
Loading

0 comments on commit da02cfc

Please sign in to comment.