Try again #309
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: | |
push: | |
branches: | |
- mise | |
jobs: | |
test_linux_bash: | |
name: Test Linux script with bash shell | |
runs-on: ubuntu-latest | |
env: | |
SHELL: /bin/bash | |
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 }}-bash-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/Linux.sh') }} | |
path: priv/static/Linux.sh | |
- name: Install expect tool | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: sudo apt-get update && sudo apt-get install -y expect | |
- name: Test the script | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: cd test/scripts && expect script.exp Linux.sh | |
shell: /bin/bash -l {0} | |
- name: Generate an app and start the server | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: /bin/bash -c 'source ~/.bash_profile && make -f test/scripts/Makefile serve' | |
shell: /bin/bash -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 | |
test_linux_zsh: | |
name: Test Linux script with zsh shell | |
runs-on: ubuntu-latest | |
env: | |
SHELL: /bin/zsh | |
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 }}-zsh-script-${{ hashFiles('test/scripts/script.exp') }}-${{ hashFiles('priv/static/Linux.sh') }} | |
path: priv/static/Linux.sh | |
- name: Install shell | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: sudo apt-get update && sudo apt-get install -y zsh | |
- name: Install expect tool | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: sudo apt-get update && sudo apt-get install -y expect | |
- name: Test the script | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: cd test/scripts && expect script.exp Linux.sh | |
shell: /bin/zsh -l {0} | |
- name: Generate an app and start the server | |
if: steps.result_cache.outputs.cache-hit != 'true' | |
run: /bin/zsh -c 'source ~/.zshrc && make -f test/scripts/Makefile serve' | |
shell: /bin/zsh -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_linux_bash | |
- test_linux_zsh | |
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 }} |