Skip to content

Commit

Permalink
feat: macOS runner support (#37)
Browse files Browse the repository at this point in the history
Co-authored-by: antazoey <[email protected]>
  • Loading branch information
antazoey and antazoey authored Jan 13, 2025
1 parent 2857588 commit 9f9a6f5
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 25 deletions.
15 changes: 9 additions & 6 deletions .github/workflows/test_ape_version.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,29 @@ concurrency:
cancel-in-progress: true

jobs:
run-this-action:
name: Run action (${{ matrix.version }})
runs-on: [ubuntu-latest]
test-version:
name: Test version (${{ matrix.os }} ${{ matrix.version }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
version:
[
'default',
'0.8.10',
'==0.8.10',
'0.8.24',
'==0.8.24',
'git+https://github.com/ApeWorX/ape.git@main',
]
runs-on: ${{ matrix.os }}
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

- name: Check version pin
id: check-version
run: |
if [[ ${{ matrix.version }} == "default" ]]; then
if [[ "${{ matrix.version }}" == "default" ]]; then
echo "ape-version=''" >> $GITHUB_OUTPUT
else
echo "ape-version=${{ matrix.version }}" >> $GITHUB_OUTPUT
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/test_plugins.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ concurrency:
cancel-in-progress: true

jobs:
run-this-action:
name: Run action (${{ matrix.plugins }})
runs-on: [ubuntu-latest]
test-plugins:
name: Test plugins (${{ matrix.plugins }})
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
plugins: [
'default_with_version_config',
'default_without_version_in_config',
'tokens',
'tokens==0.8.0'
'tokens==0.8.3'
]
runs-on: ${{ matrix.os }}
env:
GITHUB_ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4

Expand All @@ -37,7 +40,7 @@ jobs:
if [[ "${{ matrix.plugins }}" == "default_without_version_in_config" ]]; then
# Remove the version so it defaults to `. -U`.
sed -i 's/version: 0.8.0//g' "ape-config.yaml"
awk '!/version: 0.8.3/' "ape-config.yaml" > "ape-config.tmp" && mv "ape-config.tmp" "ape-config.yaml"
fi
- name: Run ape action
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ steps:
- uses: ApeWorX/github-action@v3
with:
python-version: '3.10' # (optional)
ape-version-pin: '>=0.8.10' # (optional)
ape-plugins-list: 'solidity vyper==0.8.4' # (optional)
ape-version-pin: '>=0.8.24' # (optional)
ape-plugins-list: 'solidity vyper==0.8.8' # (optional)
- run: ape test -s
```
Expand Down
25 changes: 14 additions & 11 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,18 @@ runs:
# in the cache action:
# https://github.com/actions/cache/issues/1241
if [ ! -d "/home/runner/.solcx" ]; then
mkdir "/home/runner/.solcx"
echo "Solcx directory created."
fi
if [ ! -d "/home/runner/.vvm" ]; then
mkdir "/home/runner/.vvm"
echo "VVM directory created."
fi
if [ ! -d "${{ github.workspace }}/.build" ]; then
mkdir "${{ github.workspace }}/.build"
echo ".build directory created."
# NOTE: If /home/runner does not exist, mkdir fails.
if [ -d "$HOME" ]; then
if [ ! -d "$HOME/.solcx" ]; then
mkdir "$HOME/.solcx"
echo "Solcx directory created."
fi
if [ ! -d "$HOME/.vvm" ]; then
mkdir "$HOME/.vvm"
echo "VVM directory created."
fi
if [ ! -d "$HOME/.build" ]; then
mkdir "$HOME/.build"
echo ".build directory created."
fi
fi
2 changes: 1 addition & 1 deletion ape-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file exists only as a test for the action.
plugins:
- name: tokens
version: 0.8.0
version: 0.8.3

0 comments on commit 9f9a6f5

Please sign in to comment.