This commit is contained in:
ok-nick 2022-07-18 12:07:51 -04:00
parent 88c4233299
commit b999011306
3 changed files with 98 additions and 38 deletions

View file

@ -1,15 +1,50 @@
name: Build Test Environment name: Test
description: Build test environment for setup-aftman description: Test
author: ok-nick author: ok-nick
# same input as `setup-aftman`
inputs:
version:
required: false
no-trust-check:
default: 'false'
required: false
trusts:
required: false
path:
default: '.'
required: false
token:
default: '${{ github.token }}'
required: false
defaults:
run:
shell: bash
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- uses: actions/checkout@v3
- name: Setup environment
uses: ./.github/actions/env
- shell: bash - shell: bash
run: | run: |
cat > ./aftman.toml << EOF cat > ${{ inputs.path}}/aftman.toml << EOF
[tools] [tools]
selene = "Kampfkarren/selene@0.19.1" selene = "Kampfkarren/selene@0.19.1"
stylua = "JohnnyMorganz/stylua@0.14.0" stylua = "JohnnyMorganz/stylua@0.14.0"
rojo = "rojo-rbx/rojo@7.2.1" rojo = "rojo-rbx/rojo@7.2.1"
EOF EOF
- name: Run setup-aftman
uses: ./
with:
version: ${{ inputs.version }}
no-trust-check: ${{ inputs.no-trust-check }}
trusts: ${{ inputs.trusts }}
path: ${{ inputs.path }}
token: ${{ inputs.token }}

View file

@ -2,45 +2,72 @@ name: CI
on: [push, pull_request] on: [push, pull_request]
jobs: jobs:
test_linux: test_linux_no_trust:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v3 - uses: ./.github/actions/env
- name: Setup environment
uses: ./.github/actions/env
- name: Run setup-aftman
uses: ./
with: with:
no-trust-check: true no-trust-check: true
token: ${{ secrets.GITHUB_TOKEN }}
test_mac: test_mac_no_trust:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v3 - uses: ./.github/actions/env
- name: Setup environment
uses: ./.github/actions/env
- name: Run setup-aftman
uses: ./
with: with:
no-trust-check: true no-trust-check: true
token: ${{ secrets.GITHUB_TOKEN }}
test_windows: test_windows_no_trust:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v3 - uses: ./.github/actions/env
- name: Setup environment
uses: ./.github/actions/env
- name: Run setup-aftman
uses: ./
with: with:
no-trust-check: true no-trust-check: true
token: ${{ secrets.GITHUB_TOKEN }}
test_linux_with_trust:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/env
with:
trusts: "Kampfkarren/selene JohnnyMorganz/stylua rojo-rbx/rojo"
test_mac_with_trust:
runs-on: macos-latest
steps:
- uses: ./.github/actions/env
with:
trusts: "Kampfkarren/selene JohnnyMorganz/stylua rojo-rbx/rojo"
test_windows_with_trust:
runs-on: windows-latest
steps:
- uses: ./.github/actions/env
with:
trusts: "Kampfkarren/selene JohnnyMorganz/stylua rojo-rbx/rojo"
test_linux_version_and_path:
runs-on: ubuntu-latest
steps:
- uses: ./.github/actions/env
run: "mkdir project"
with:
version: 0.2.2
path: "./project"
test_mac_version_and_path:
runs-on: macos-latest
steps:
- uses: ./.github/actions/env
run: "mkdir project"
with:
version: 0.2.2
path: "./project"
test_windows_version_and_path:
runs-on: windows-latest
steps:
- uses: ./.github/actions/env
run: "mkdir project"
with:
version: 0.2.2
path: "./project"

View file

@ -15,39 +15,39 @@ inputs:
required: false required: false
path: path:
description: 'Path to the `aftman.toml` directory' description: 'Path to the `aftman.toml` directory'
default: './' default: '.'
required: false required: false
token: token:
description: 'Github token from `github.token`' description: 'Github token from `github.token`'
default: '${{ github.token }}' default: '${{ github.token }}'
required: true required: false
defaults:
run:
shell: bash
runs: runs:
using: 'composite' using: 'composite'
steps: steps:
- name: Download aftman - name: Download aftman
if: runner.os == 'Linux' if: runner.os == 'Linux'
shell: bash
run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *linux-x86_64.zip run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *linux-x86_64.zip
env: env:
GITHUB_TOKEN: ${{ inputs.token }} GITHUB_TOKEN: ${{ inputs.token }}
- name: Download aftman - name: Download aftman
if: runner.os == 'macOS' if: runner.os == 'macOS'
shell: bash
run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *macos-x86_64.zip run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *macos-x86_64.zip
env: env:
GITHUB_TOKEN: ${{ inputs.token }} GITHUB_TOKEN: ${{ inputs.token }}
- name: Download aftman - name: Download aftman
if: runner.os == 'Windows' if: runner.os == 'Windows'
shell: bash
run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *windows-x86_64.zip run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *windows-x86_64.zip
env: env:
GITHUB_TOKEN: ${{ inputs.token }} GITHUB_TOKEN: ${{ inputs.token }}
- name: Install aftman - name: Install aftman
shell: bash
run: | run: |
unzip aftman*.zip unzip aftman*.zip
./aftman self-install ./aftman self-install
@ -55,14 +55,12 @@ runs:
- name: Setup trusts - name: Setup trusts
if: ${{ inputs.no-trust-check == false }} if: ${{ inputs.no-trust-check == false }}
shell: bash
run: | run: |
for name in ${{ inputs.trusts }}; do for name in ${{ inputs.trusts }}; do
aftman trust $name aftman trust $name
done done
- name: Install tools - name: Install tools
shell: bash
run: | run: |
cd ${{ inputs.path }} cd ${{ inputs.path }}
if [ ${{ inputs.no-trust-check }} == true ]; then if [ ${{ inputs.no-trust-check }} == true ]; then