Refactor: housekeeping 2 20 24 #436
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: Windows | |
on: | |
pull_request: | |
branches: [master] | |
workflow_dispatch: | |
concurrency: | |
group: "windows-test" | |
cancel-in-progress: true | |
jobs: | |
smoke: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: dev | |
- name: Setup Conduit | |
run: | | |
dart pub global activate melos | |
dart pub global activate -spath packages/cli | |
- name: Run tests | |
working-directory: ../ | |
run: | | |
conduit create -t db_and_auth --offline wildfire | |
cd wildfire/ | |
echo "----------- Building test project -----------" | |
conduit build | |
conduit db generate | |
unit: | |
needs: smoke | |
if: | | |
startsWith(github.head_ref, 'feature/') | |
|| startsWith(github.head_ref, 'fix/') | |
|| startsWith(github.head_ref, 'refactor/') | |
runs-on: windows-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
runner_args: [melos test-unit, dart tool/generated_test_runner.dart] | |
env: | |
TEST_DIR: packages/core | |
POSTGRES_HOST: localhost | |
POSTGRES_PORT: 15432 | |
POSTGRES_USER: conduit_test_user | |
POSTGRES_PASSWORD: conduit! | |
POSTGRES_DB: conduit_test_db | |
TEST_DB_ENV_VAR: postgres://user:password@host:5432/dbname | |
TEST_VALUE: 1 | |
TEST_BOOL: true | |
steps: | |
- name: Start PostgreSQL | |
run: | | |
mkdir C:\datadir | |
icacls "C:\datadir" /grant Users:F /T | |
& $env:PGBIN\initdb -U postgres -D C:\datadir | |
& $env:PGBIN\pg_ctl -o "-p ${{ env.POSTGRES_PORT }}" -D C:\datadir start | |
- name: Create database | |
env: | |
PGUSER: postgres | |
PGPORT: 15432 | |
run: | | |
& $env:PGBIN\createuser -s -e -g postgres ${{ env.POSTGRES_USER }} | |
& $env:PGBIN\psql --command="ALTER USER ${{ env.POSTGRES_USER }} WITH PASSWORD '${{ env.POSTGRES_PASSWORD }}'" | |
& $env:PGBIN\createdb --owner=${{ env.POSTGRES_USER }} ${{ env.POSTGRES_DB }} | |
- uses: actions/checkout@v3 | |
- uses: dart-lang/setup-dart@v1 | |
with: | |
sdk: dev | |
- name: Get Dependencies | |
run: | | |
choco install yq | |
dart pub global activate -spath packages/cli | |
dart pub global activate melos | |
dart pub global run melos:melos bootstrap | |
dart pub global run melos:melos cache-source-win | |
dart pub get --directory=packages/isolate_exec_test_packages/test_package --offline | |
dart pub get --directory=packages/runtime_test_packages/application --offline | |
dart pub get --directory=packages/runtime_test_packages/dependency --offline | |
- name: Run tests | |
env: | |
CONDUIT_CI_DIR_LOCATION: ${{ github.workspace }}\ci\ | |
working-directory: ${{ env.TEST_DIR }} | |
run: ${{ matrix.runner_args }} |