mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-30 16:58:38 +00:00
Use actions-setup-mysql for MySQL
This commit is contained in:
parent
12b917b0a7
commit
f86582e393
1 changed files with 15 additions and 6 deletions
19
.github/workflows/ci.yml
vendored
19
.github/workflows/ci.yml
vendored
|
@ -7,6 +7,7 @@ name: Continuous Integration
|
|||
jobs:
|
||||
test:
|
||||
name: Build & Test
|
||||
if: "!contains(github.event.head_commit.message, '[skip ci]')"
|
||||
runs-on: ${{matrix.os.fullName}}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
|
@ -21,6 +22,11 @@ jobs:
|
|||
DB_USER: lighthouse
|
||||
DB_PASSWORD: lighthouse
|
||||
steps:
|
||||
- name: Cancel previous runs of this workflow
|
||||
uses: styfle/cancel-workflow-action@0.6.0
|
||||
with:
|
||||
access_token: ${{ github.token }}
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
|
||||
|
@ -40,14 +46,17 @@ jobs:
|
|||
run: dotnet build -c Debug
|
||||
|
||||
- name: Start MySQL
|
||||
if: ${{ matrix.os.database }}
|
||||
run: |
|
||||
sudo service mysql start
|
||||
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
|
||||
uses: shogo82148/actions-setup-mysql@v1
|
||||
with:
|
||||
user: ${{ env.DB_USER }}
|
||||
password: ${{ env.DB_PASSWORD }}
|
||||
mysql-version: '8.0'
|
||||
|
||||
- name: Run database migrations
|
||||
if: ${{ matrix.os.database }}
|
||||
run: mysql --batch -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < <(cat DatabaseMigrations/*.sql)
|
||||
run: |
|
||||
mysql -e 'CREATE DATABASE ${{ env.DB_DATABASE }};' -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }}
|
||||
mysql --batch -u${{ env.DB_USER }} -p${{ env.DB_PASSWORD }} ${{ env.DB_DATABASE }} < <(cat DatabaseMigrations/*.sql)
|
||||
|
||||
- name: Test
|
||||
continue-on-error: true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue