Support fish shell #365
Workflow file for this run
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
name: PR | |
on: | |
pull_request: | |
branches: | |
- main | |
types: | |
- opened | |
- reopened | |
- synchronize | |
jobs: | |
test_macos_fish: | |
name: Test macOS script with fish shell | |
runs-on: macos-latest | |
env: | |
SHELL: /bin/fish | |
TZ: America/New_York | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Restore script result cache | |
uses: actions/cache@v3 | |
id: result_cache | |
with: | |
key: ${{ runner.os }}-fish-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/script.sh') }} | |
path: priv/static/macOS.sh | |
- name: Install shell | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: brew install fish | |
- name: Disable password prompt for macOS | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: 'sudo sed -i "" "s/%admin ALL = (ALL) ALL/%admin ALL = (ALL) NOPASSWD: ALL/g" /etc/sudoers' | |
- name: Install expect tool | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: brew install expect | |
- name: Remove mise config files | |
run: rm -f .mise.toml .tool-versions | |
- name: Setup Debug Session | |
uses: csexton/debugger-action@master | |
- name: Test the script | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: cd test/scripts && expect -d script.exp | |
shell: /bin/fish -l {0} | |
- name: Generate an app and start the server | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: make -f test/scripts/Makefile serve | |
shell: /bin/fish -l {0} | |
- name: Check HTTP status code | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
uses: nick-fields/retry@v2 | |
with: | |
command: INPUT_SITES='["http://localhost:4000"]' INPUT_EXPECTED='[200]' ./test/scripts/check_status_code.sh | |
max_attempts: 7 | |
retry_wait_seconds: 5 | |
timeout_seconds: 1 | |
deploy_preview_app: | |
name: Deploy preview app | |
needs: | |
- test_macos_fish | |
runs-on: ubuntu-latest | |
permissions: write-all | |
concurrency: | |
group: pr-${{ github.event.number }} | |
environment: | |
name: pr-${{ github.event.number }} | |
url: https://phx-tools-pr-${{ github.event.number }}.fly.dev | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Delete previous deployments | |
uses: strumwolf/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
environment: pr-${{ github.event.number }} | |
ref: ${{ github.head_ref }} | |
onlyRemoveDeployments: true | |
- name: Deploy preview app | |
uses: optimumBA/fly-preview-apps@main | |
env: | |
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }} | |
FLY_ORG: optimum-bh | |
FLY_REGION: fra | |
PHX_HOST: phx-tools-pr-${{ github.event.number }}.fly.dev | |
REPO_NAME: phx_tools | |
with: | |
name: phx-tools-pr-${{ github.event.number }} | |
secrets: APPSIGNAL_APP_ENV=preview APPSIGNAL_PUSH_API_KEY=${{ secrets.APPSIGNAL_PUSH_API_KEY }} PHX_HOST=${{ env.PHX_HOST }} SECRET_KEY_BASE=${{ secrets.SECRET_KEY_BASE }} |