Skip to content

Commit

Permalink
Test on various OSs
Browse files Browse the repository at this point in the history
  • Loading branch information
mateuszkwiecinski committed Mar 10, 2024
1 parent 6ed073b commit 69a6657
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,18 @@ jobs:
comment-id: ${{ steps.find_comment.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
token: ${{ secrets.GITHUB_TOKEN }}

os-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
name: Run action
steps:
- uses: actions/checkout@v4

- id: agp-version-finder
uses: ./

- run: echo "${{join(steps.agp-version-finder.outputs.*, '\n')}}"
12 changes: 8 additions & 4 deletions entrypoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ def version_regex(_suffix):
def is_debug():
return os.getenv("INPUT_DEBUG", False)

def github_output(key, value):
with open(os.environ['GITHUB_OUTPUT'], mode='a', encoding='UTF-8') as fh:
print(f'{key}<<{value}', file=fh)


url = "https://dl.google.com/android/maven2/com/android/tools/build/gradle/maven-metadata.xml"
stable_regex = re.compile(r"^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)$")
Expand Down Expand Up @@ -39,7 +43,7 @@ def is_debug():
rc_count={len(all_rc)}
""")

os.system(f"echo \"latest-stable={all_stable[-1]}\" >> $GITHUB_OUTPUT")
os.system(f"echo \"latest-alpha={all_alpha[-1]}\" >> $GITHUB_OUTPUT")
os.system(f"echo \"latest-beta={all_beta[-1]}\" >> $GITHUB_OUTPUT")
os.system(f"echo \"latest-rc={all_rc[-1]}\" >> $GITHUB_OUTPUT")
github_output(key="latest-stable", value=all_stable[-1])
github_output(key="latest-alpha", value=all_stable[-1])
github_output(key="latest-beta", value=all_beta[-1])
github_output(key="latest-rc", value=all_rc[-1])

0 comments on commit 69a6657

Please sign in to comment.