Build docs as CI artifacts #1985
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
pull_request: | |
push: | |
env: | |
node-version: 18.x | |
jobs: | |
elixir: | |
runs-on: ubuntu-20.04 | |
env: | |
MIX_ENV: test | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- pair: # Test very old Elixir and Erlang | |
elixir: "1.14" | |
otp: "25" | |
- pair: # Test Erlang without -doc attribute support | |
elixir: "1.16" | |
otp: "26" | |
- pair: # Test Erlang with -doc attribute support | |
elixir: "1.17" | |
otp: "27" | |
lint: lint | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: erlef/setup-beam@v1 | |
with: | |
otp-version: ${{matrix.pair.otp}} | |
elixir-version: ${{matrix.pair.elixir}} | |
- name: Install Dependencies | |
run: mix deps.get | |
- run: mix format --check-formatted | |
if: ${{ matrix.lint }} | |
- run: mix deps.unlock --check-unused | |
if: ${{ matrix.lint }} | |
- run: mix deps.compile | |
- run: mix compile --warnings-as-errors | |
if: ${{ matrix.lint }} | |
- run: mix test | |
- name: Prerelease | |
run: test/prerelease.sh | |
js: | |
runs-on: ubuntu-20.04 | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: ${{ env.node-version }} | |
- name: Cache npm dependencies | |
uses: actions/cache@v3 | |
with: | |
path: ~/.npm | |
key: ${{ runner.os }}-node-${{ hashFiles('asssets/package-lock.json') }} | |
- run: npm ci --prefix assets | |
- run: npm run lint --prefix assets | |
- name: npm run test --prefix assets | |
run: | | |
sudo apt-get install xvfb | |
xvfb-run --auto-servernum npm run test --prefix assets | |
env: | |
CI: true | |
- name: Push updated assets | |
if: github.ref_name == 'main' | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update assets | |
file_pattern: formatters | |
- name: Generate docs | |
run: | | |
mix build | |
test -f doc/index.html && echo "doc/index.html exists." | |
test -f doc/ExDoc.epub && echo "doc/ExDoc.epub exists." | |
- name: Upload docs | |
uses: actions/upload-artifact@v4 | |
with: | |
name: docs | |
path: doc/ |