remove windows tests #18
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: Sage Install Tests | |
on: | |
push: | |
pull_request: | |
branches: | |
- main | |
paths: | |
- '/private/scripts/**' | |
jobs: | |
linux: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
php-version: [8.0, 8.1, 8.2] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Get PR number | |
id: pr | |
run: echo "::set-output name=pull_request_number::$(gh pr view --json number -q .number || echo "")" | |
env: | |
GITHUB_TOKEN: ${{ github.token }} | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: ${{ matrix.php-version }} | |
- name: Generate multidev name | |
id: generate_name | |
run: | | |
os_short="" | |
case "${{ matrix.os }}" in | |
ubuntu-latest) | |
os_short="nix" | |
;; | |
macos-latest) | |
os_short="mac" | |
;; | |
windows-latest) | |
os_short="win" | |
;; | |
esac | |
php_short=$(echo "${{ matrix.php-version }}" | tr -d '.') | |
pr_num=$(echo ${{ steps.pr.outputs.pull_request_number }}) | |
echo "PR number: $pr_num" | |
echo "OS: $os_short" | |
echo "PHP: $php_short" | |
multidev_name="${os_short}-${php_short}-${pr_num}" | |
echo "Generated multidev name: $multidev_name" | |
echo "multidev_name=$multidev_name" >> $GITHUB_ENV | |
- name: Get latest Terminus release | |
run: | | |
latest_version=$(curl --silent "https://api.github.com/repos/pantheon-systems/terminus/releases/latest" | jq -r .tag_name) | |
echo "Terminus Latest version is $latest_version" | |
curl -L "https://github.com/pantheon-systems/terminus/releases/download/$latest_version/terminus.phar" -o terminus | |
chmod +x terminus | |
sudo mv terminus /usr/local/bin/ | |
- name: Install Composer Dependencies | |
run: composer install --no-progress --no-suggest --prefer-dist | |
- name: Log into Terminus & Create Multidev | |
run: | | |
terminus auth:login --machine-token=${{ secrets.TERMINUS_TOKEN }} | |
terminus upstream:updates:apply wpcm-sage-install-tests.dev --accept-upstream | |
terminus multidev:create wpcm-sage-install-tests.dev $multidev_name | |
- name: Run Sage Install Script | |
run: | | |
composer install-sage || exit_code=$? | |
if [[ -n "${exit_code}" ]]; then | |
echo "❌ Sage Install Script Failed with exit code ${exit_code}" | |
exit $exit_code | |
else | |
echo "✅ Sage Install Script passed!" | |
exit 0; | |
fi | |
- name: Delete multidev | |
if: always() | |
run: terminus multidev:delete --delete-branch --yes wpcm-sage-install-tests.$multidev_name |