Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use reusable workflow from TanklesXL/gleam_actions #36

Merged
merged 2 commits into from
May 6, 2024
Merged
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
21 changes: 5 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ jobs:

release-gh:
runs-on: ubuntu-latest
needs: [test, version]
needs:
- test
- version
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -34,18 +36,5 @@ jobs:
runs-on: ubuntu-latest
needs: [test, version]
steps:
- uses: actions/checkout@v2
- uses: actions/cache/restore@v4
with:
path: ./build/packages
key: deps-${{ hashFiles('manifest.toml') }}
- uses: erlef/setup-beam@v1
with:
otp-version: 26
rebar3-version: 3
gleam-version: "1.1.0"
- name: publish to hex
env:
HEXPM_USER: ${{ secrets.HEXPM_USER }}
HEXPM_PASS: ${{ secrets.HEXPM_PASS }}
run: gleam publish -y
- uses: actions/checkout@v4
- uses: TanklesXL/gleam_actions/actions/hex_publish@main
56 changes: 12 additions & 44 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: Test
env:
GLEAM_VERSION: "1.1.0"
ERLANG_VERSION: 26
REBAR3_VERSION: 3

on:
push:
Expand All @@ -17,36 +16,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: erlef/setup-beam@v1
- uses: TanklesXL/gleam_actions/actions/format@main
with:
otp-version: ${{ env.ERLANG_VERSION }}
rebar3-version: ${{ env.REBAR3_VERSION }}
gleam-version: ${{ env.GLEAM_VERSION }}
- run: gleam format --check src test
gleam_version: ${{ env.GLEAM_VERSION }}

deps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check cache
uses: actions/cache/restore@v4
id: restore
- uses: TanklesXL/gleam_actions/actions/deps_cache@main
with:
path: ./build/packages
key: deps-${{ hashFiles('manifest.toml') }}
- if: ${{ steps.restore.outputs.cache-hit != 'true' }}
uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.ERLANG_VERSION }}
rebar3-version: ${{ env.REBAR3_VERSION }}
gleam-version: ${{ env.GLEAM_VERSION }}
- if: ${{ steps.restore.outputs.cache-hit != 'true' }}
run: gleam deps download
- if: ${{ steps.restore.outputs.cache-hit != 'true' }}
uses: actions/cache/save@v4
with:
path: ./build/packages
key: deps-${{ hashFiles('manifest.toml') }}
gleam_version: ${{ env.GLEAM_VERSION }}

test_erlang:
runs-on: ubuntu-latest
Expand All @@ -57,16 +37,11 @@ jobs:
erlang: ["26", "25", "27.0-rc3"]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: ./build/packages
key: deps-${{ hashFiles('manifest.toml') }}
- uses: erlef/setup-beam@v1
- uses: TanklesXL/gleam_actions/actions/deps_restore@main
- uses: TanklesXL/gleam_actions/actions/test_erlang@main
with:
otp-version: ${{matrix.erlang}}
rebar3-version: ${{ env.REBAR3_VERSION }}
gleam-version: ${{env.GLEAM_VERSION}}
- run: gleam test --target erlang
erlang_version: ${{ matrix.erlang }}
gleam_version: ${{ env.GLEAM_VERSION }}

test_node:
runs-on: ubuntu-latest
Expand All @@ -77,15 +52,8 @@ jobs:
node: ["22", "20", "18"]
steps:
- uses: actions/checkout@v4
- uses: actions/cache/restore@v4
with:
path: ./build/packages
key: deps-${{ hashFiles('manifest.toml') }}
- uses: erlef/setup-beam@v1
with:
otp-version: ${{ env.ERLANG_VERSION }}
gleam-version: ${{env.GLEAM_VERSION}}
- uses: actions/setup-node@v4
- uses: TanklesXL/gleam_actions/actions/deps_restore@main
- uses: TanklesXL/gleam_actions/actions/test_node@main
with:
node-version: ${{matrix.node}}
- run: gleam test --target javascript
node_version: ${{ matrix.node }}
gleam_version: ${{ env.GLEAM_VERSION }}