From b9990113069ec67b183f7960cc21b89ac0e8f14b Mon Sep 17 00:00:00 2001 From: ok-nick <25470747+ok-nick@users.noreply.github.com> Date: Mon, 18 Jul 2022 12:07:51 -0400 Subject: [PATCH] update --- .github/actions/env/action.yml | 41 +++++++++++++++-- .github/workflows/CI.yml | 81 ++++++++++++++++++++++------------ action.yml | 14 +++--- 3 files changed, 98 insertions(+), 38 deletions(-) diff --git a/.github/actions/env/action.yml b/.github/actions/env/action.yml index 5f0904e..4b94083 100644 --- a/.github/actions/env/action.yml +++ b/.github/actions/env/action.yml @@ -1,15 +1,50 @@ -name: Build Test Environment -description: Build test environment for setup-aftman +name: Test +description: Test 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: using: 'composite' steps: + - uses: actions/checkout@v3 + + - name: Setup environment + uses: ./.github/actions/env + - shell: bash run: | - cat > ./aftman.toml << EOF + 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" 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 }} + diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index a033c51..218f772 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -2,45 +2,72 @@ name: CI on: [push, pull_request] jobs: - test_linux: + test_linux_no_trust: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Setup environment - uses: ./.github/actions/env - - - name: Run setup-aftman - uses: ./ + - uses: ./.github/actions/env with: no-trust-check: true - token: ${{ secrets.GITHUB_TOKEN }} - test_mac: + test_mac_no_trust: runs-on: macos-latest steps: - - uses: actions/checkout@v3 - - - name: Setup environment - uses: ./.github/actions/env - - - name: Run setup-aftman - uses: ./ + - uses: ./.github/actions/env with: no-trust-check: true - token: ${{ secrets.GITHUB_TOKEN }} - test_windows: + test_windows_no_trust: runs-on: windows-latest steps: - - uses: actions/checkout@v3 - - - name: Setup environment - uses: ./.github/actions/env - - - name: Run setup-aftman - uses: ./ + - uses: ./.github/actions/env with: 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" diff --git a/action.yml b/action.yml index e04c2b7..3c021ec 100644 --- a/action.yml +++ b/action.yml @@ -15,39 +15,39 @@ inputs: required: false path: description: 'Path to the `aftman.toml` directory' - default: './' + default: '.' required: false token: description: 'Github token from `github.token`' default: '${{ github.token }}' - required: true + required: false + +defaults: + run: + shell: bash runs: using: 'composite' steps: - name: Download aftman if: runner.os == 'Linux' - shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *linux-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Download aftman if: runner.os == 'macOS' - shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *macos-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Download aftman if: runner.os == 'Windows' - shell: bash run: gh release download ${{ inputs.version }} --repo LPGhatguy/aftman --pattern *windows-x86_64.zip env: GITHUB_TOKEN: ${{ inputs.token }} - name: Install aftman - shell: bash run: | unzip aftman*.zip ./aftman self-install @@ -55,14 +55,12 @@ runs: - name: Setup trusts if: ${{ inputs.no-trust-check == false }} - shell: bash run: | for name in ${{ inputs.trusts }}; do aftman trust $name done - name: Install tools - shell: bash run: | cd ${{ inputs.path }} if [ ${{ inputs.no-trust-check }} == true ]; then