-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GHA): create composite action for setup
- Loading branch information
Showing
2 changed files
with
43 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: 'Setup OpenWPM env' | ||
description: 'Sets up conda and installs dependencies' | ||
runs: | ||
using: "composite" | ||
steps: | ||
# All of these steps are just setup | ||
- name: Setting MAMBA_PATH | ||
shell: bash | ||
run: echo "MAMBA_PATH=$HOME/mamba" >> $GITHUB_ENV | ||
- name: Setting OPENWPM_MAMBA_PATH | ||
shell: bash | ||
run: echo "OPENWPM_MAMBA_PATH=$MAMBA_PATH/envs/openwpm" >> $GITHUB_ENV | ||
# If the environment.yaml hasn't changed we just reuse the entire conda install | ||
- id: cache | ||
uses: actions/cache@v4 | ||
env: | ||
cache-name: conda-cache | ||
with: | ||
path: ${{ env.MAMBA_PATH }} | ||
key: ${{ env.cache-name }}-${{ hashFiles('environment.yaml') }} | ||
|
||
- name: Install conda | ||
shell: bash | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: $GITHUB_WORKSPACE/scripts/install-mamba.sh | ||
|
||
- shell: bash | ||
run: echo "$MAMBA_PATH/bin" >> $GITHUB_PATH | ||
|
||
- name: Install.sh (cache miss) | ||
shell: bash | ||
if: ${{ steps.cache.outputs.cache-hit != 'true' }} | ||
run: $GITHUB_WORKSPACE/install.sh | ||
- name: Install.sh (cache hit) | ||
shell: bash | ||
if: ${{ steps.cache.outputs.cache-hit == 'true' }} | ||
run: $GITHUB_WORKSPACE/install.sh --skip-create | ||
- shell: bash | ||
run: echo "$OPENWPM_MAMBA_PATH/bin" >> $GITHUB_PATH | ||
# Now we have a working OpenWPM environment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters