Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/file-filters.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Used by GitHub Action https://github.com/dorny/paths-filter

elixir:
- "**/*"
# Ignore
- "!*.md"
- "!lib/*/pages/**/*.md"

docs:
- ".github/workflows/ci.yml"
- "CHANGELOG.md"
- "Makefile"
- "VERSION"
- "lib/**/*"
# Ignore
- "!lib/*/test/**/*"
53 changes: 39 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,7 @@ name: CI

on:
push:
paths-ignore:
- "lib/**/*.md"

pull_request:
paths-ignore:
- "lib/**/*.md"

env:
ELIXIR_ASSERT_TIMEOUT: 2000
Expand All @@ -23,7 +18,12 @@ permissions:

jobs:
test_linux:
name: Ubuntu 24.04, OTP ${{ matrix.otp_version }}${{ matrix.deterministic && ' (deterministic)' || '' }}${{ matrix.coverage && ' (coverage)' || '' }}
name: >-
Ubuntu 24.04, OTP ${{ matrix.otp_version }}
${{ matrix.docs && ' (docs)' || '' }}
${{ matrix.coverage && ' (coverage)' || '' }}
${{ matrix.deterministic && ' (deterministic)' || '' }}

runs-on: ubuntu-24.04

strategy:
Expand Down Expand Up @@ -51,10 +51,19 @@ jobs:
# from Erlang/OTP 27+.
env:
ERLC_OPTS: ${{ matrix.erlc_opts || '' }}

steps:
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Detect changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: .github/file-filters.yml

- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
- name: Setup BEAM
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: ${{ matrix.otp_version }}

Expand All @@ -63,6 +72,7 @@ jobs:
run: echo "ERL_COMPILER_OPTIONS=deterministic" >> $GITHUB_ENV

- name: Compile Elixir
if: steps.changes.outputs.elixir == 'true'
run: |
make compile
echo "$PWD/bin" >> $GITHUB_PATH
Expand All @@ -71,20 +81,23 @@ jobs:
run: bin/elixir --version

- name: Check format
if: steps.changes.outputs.elixir == 'true'
run: make test_formatted && echo "All Elixir source code files are properly formatted."

- name: Erlang test suite
if: steps.changes.outputs.elixir == 'true'
run: make test_erlang
continue-on-error: ${{ matrix.development == true }}

- name: Elixir test suite
if: steps.changes.outputs.elixir == 'true'
run: make test_elixir
continue-on-error: ${{ matrix.development == true }}
env:
COVER: "${{ matrix.coverage }}"

- name: Build docs (ExDoc main)
if: ${{ matrix.docs }}
if: matrix.docs && steps.changes.outputs.docs == 'true'
run: |
cd ..
git clone https://github.com/elixir-lang/ex_doc.git --depth 1
Expand All @@ -95,18 +108,18 @@ jobs:
DOCS_OPTIONS="--warnings-as-errors" make docs

- name: "Calculate Coverage"
if: ${{ matrix.coverage }}
if: matrix.coverage && steps.changes.outputs.elixir == 'true'
run: make cover | tee "$GITHUB_STEP_SUMMARY"

- name: "Upload Coverage Artifact"
if: ${{ matrix.coverage }}
if: matrix.coverage && steps.changes.outputs.elixir == 'true'
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
with:
name: TestCoverage
path: cover/*

- name: Check reproducible builds
if: ${{ matrix.deterministic }}
if: matrix.deterministic && steps.changes.outputs.elixir == 'true'
run: |
rm -rf .git
# Recompile System without .git
Expand All @@ -128,13 +141,22 @@ jobs:
- name: Configure Git
run: git config --global core.autocrlf input

- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
- name: Checkout
uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0

- name: Detect changes
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
id: changes
with:
filters: .github/file-filters.yml

- uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
- name: Setup BEAM
uses: erlef/setup-beam@e6d7c94229049569db56a7ad5a540c051a010af9 # v1.20.4
with:
otp-version: ${{ matrix.otp_version }}

- name: Compile Elixir
if: steps.changes.outputs.elixir == 'true'
run: |
Remove-Item -Recurse -Force '.git'
make compile
Expand All @@ -143,12 +165,15 @@ jobs:
run: bin/elixir --version

- name: Check format
if: steps.changes.outputs.elixir == 'true'
run: make test_formatted && echo "All Elixir source code files are properly formatted."

- name: Erlang test suite
if: steps.changes.outputs.elixir == 'true'
run: make test_erlang

- name: Elixir test suite
if: steps.changes.outputs.elixir == 'true'
run: |
Remove-Item 'c:/Windows/System32/drivers/etc/hosts'
make test_elixir
Expand Down