Skip to content

Commit

Permalink
Standardize git action files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrcage authored and usp-npe committed Sep 5, 2022
1 parent db7318f commit d17dfa5
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 34 deletions.
59 changes: 29 additions & 30 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,44 +2,43 @@ name: CI

on:
push:
branches: [ master ]
branches: [master]
pull_request:
branches: [ master ]
branches: [master]

env:
PHP_VERSION: "8.1"
NODE_VERSION: "16.x"

jobs:
laravel-tests:
name: Laravel tests
runs-on: ubuntu-latest

strategy:
matrix:
node-version: [16.x]
php-version: [8.1]

steps:
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php-version }}
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run dev
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
- uses: actions/checkout@v2
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ env.PHP_VERSION }}
- name: Copy .env
run: php -r "file_exists('.env') || copy('.env.example', '.env');"
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run dev
- name: Generate key
run: php artisan key:generate
- name: Directory Permissions
run: chmod -R 777 storage bootstrap/cache
- name: Create Database
run: |
mkdir -p database
touch database/database.sqlite
# - name: Execute tests (Unit and Feature tests) via PHPUnit
# env:
# DB_CONNECTION: sqlite
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ on:
push:
branches: [ production ]

env:
PHP_VERSION: '8.1'
NODE_VERSION: '16.x'

jobs:
pre-release:
name: "Pre Release"
Expand All @@ -14,13 +18,13 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: ${{ env.PHP_VERSION }}
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run prod
- name: Store Git hash
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ on:
tags:
- "v*"

env:
PHP_VERSION: '8.1'
NODE_VERSION: '16.x'

jobs:
tagged-release:
name: "Tagged Release"
Expand All @@ -15,13 +19,13 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
php-version: ${{ env.PHP_VERSION }}
- name: Install Dependencies
run: composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist --optimize-autoloader --no-dev
- name: Use Node.js
uses: actions/setup-node@v2
with:
node-version: '16.x'
node-version: ${{ env.NODE_VERSION }}
- run: npm ci
- run: npm run prod
- name: Store Git hash
Expand Down

0 comments on commit d17dfa5

Please sign in to comment.