ci: matrix and reusable workflows + test no cache

This commit is contained in:
ok-nick 2023-09-18 00:09:47 -04:00
parent 7cb084aa74
commit 9b2e586476
No known key found for this signature in database
GPG key ID: E6F3F722530600D2
3 changed files with 34 additions and 70 deletions

View file

@ -1,28 +1,35 @@
name: Test
description: Test `setup-aftman`.
author: ok-nick
# same input as `setup-aftman`
inputs:
on:
workflow_call:
inputs:
version:
required: false
type: string
path:
default: "."
required: false
type: string
cache:
required: false
type: string
token:
default: "${{ github.token }}"
required: false
type: string
runs:
using: "composite"
jobs:
test-env:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Create manifest file
run: |
cat > ${{ inputs.path }}/aftman.toml << EOF
[tools]
selene = "Kampfkarren/selene@0.19.1"
stylua = "JohnnyMorganz/stylua@0.14.0"
rojo = "rojo-rbx/rojo@7.2.1"
selene = "Kampfkarren/selene@0.25.0"
stylua = "JohnnyMorganz/stylua@0.18.2"
rojo = "rojo-rbx/rojo@7.3.0"
EOF
shell: bash
@ -31,6 +38,7 @@ runs:
with:
version: ${{ inputs.version }}
path: ${{ inputs.path }}
cache: ${{ inputs.cache }}
token: ${{ inputs.token }}
- name: Verify executables in PATH on bash

View file

@ -13,53 +13,9 @@ defaults:
shell: bash
jobs:
test_linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
test_mac:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
test_windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/test
test_linux_version_and_path:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: mkdir project
- uses: ./.github/actions/test
test-cache:
uses: ./.github/actions/env.yml
test-no-cache:
uses: ./.github/actions/env.yml
with:
version: v0.2.7
path: "./project"
test_mac_version_and_path:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- run: mkdir project
- uses: ./.github/actions/test
with:
version: v0.2.7
path: "./project"
test_windows_version_and_path:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- run: mkdir project
- uses: ./.github/actions/test
with:
version: v0.2.7
path: "./project"
cache: "false"

View file

@ -24,7 +24,7 @@ steps:
with:
version: v1.0.0 # name of git tag in aftman (uses latest by default)
path: some_dir/my_project # path to project dir containing `aftman.toml` (uses current dir by default)
cache: true # whether to enable binary caching between runs (true by default)
cache: "true" # whether to enable binary caching between runs (true by default)
token: ${{ github.token }} # GitHub token to bypass rate limit (passed by default)
```