-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #66 from my-opencode/alpha-actions
Alpha actions: integration tests
- Loading branch information
Showing
7 changed files
with
55 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Integration Tests | ||
run-name: ${{ github.actor }} is running integration tests | ||
|
||
on: [push] | ||
|
||
jobs: | ||
Integration-Tests: | ||
runs-on: ubuntu-22.04 | ||
env: | ||
MYSQL_ROOT_USER: root | ||
MYSQL_ROOT_PASSWORD: root | ||
MYSQL_DATABASE: demodb | ||
MYSQL_USER: demouser | ||
MYSQL_PASSWORD: demopswd | ||
MYSQL_TCP_PORT: 3306 | ||
MYSQL_HP: --host=localhost --port=3306 | ||
steps: | ||
- name: Copy project directory | ||
uses: actions/checkout@v4 | ||
- name: Start MySQL | ||
run: sudo /etc/init.d/mysql start && mysql -e 'CREATE DATABASE ${{ env.MYSQL_DATABASE }};' -u${{ env.MYSQL_ROOT_USER }} -p${{ env.MYSQL_ROOT_PASSWORD }} ${{env.MYSQL_HP}} | ||
- name: Create MySQL user without host | ||
run: sudo mysql -e 'CREATE USER ${{ env.MYSQL_USER }} IDENTIFIED BY "${{ env.MYSQL_PASSWORD }}";' -u${{ env.MYSQL_ROOT_USER }} -p${{ env.MYSQL_ROOT_PASSWORD }} ${{env.MYSQL_HP}} | ||
- name: Apply MySQL schema | ||
run: sudo mysql ${{ env.MYSQL_HP }} -u${{ env.MYSQL_ROOT_USER }} -p${{ env.MYSQL_ROOT_PASSWORD }} ${{ env.MYSQL_DATABASE }} < ${{ github.workspace }}/docker-entrypoint-initdb.d/001-database-model.sql | ||
- name: Populate MySQL | ||
run: sudo mysql ${{ env.MYSQL_HP }} -u${{ env.MYSQL_ROOT_USER }} -p${{ env.MYSQL_ROOT_PASSWORD }} ${{ env.MYSQL_DATABASE }} < ${{ github.workspace }}/docker-entrypoint-initdb.d/002-database-state-insert.sql | ||
- run: echo "Running Integration Tests in ${{ runner.os }} for branch ${{ github.ref }}." | ||
- name: Set Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22.x' | ||
- name: Install dependencies | ||
run: cd back && npm ci | ||
- name: Launch Integration Tests | ||
run: cd back && npm run test:integration | ||
- run: echo "Test completed with status ${{ job.status }}." |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
MYSQL_ROOT_PASSWORD=root | ||
MYSQL_DATABASE=demodb | ||
MYSQL_USER=demouser | ||
MYSQL_PASSWORD=demopswd | ||
MYSQL_TCP_PORT=3306 |
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
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
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
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
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