diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 89c0667..330dba4 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -44,7 +44,6 @@ jobs: target key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - - name: Install ${{ matrix.version }} uses: actions-rs/toolchain@v1 with: @@ -67,24 +66,22 @@ jobs: run: python ./scripts/gitea.py - name: run migrations - run: - make migrate - # env: - # GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" - # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + run: make migrate + env: + GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value + POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" + SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" - name: Generate coverage file if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'pull_request') - uses: - actions-rs/tarpaulin@v0.1 - # env: - # # GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin - # # execution so this value is required for preventing meta tests from - # # panicking - # GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 - # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" - # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + uses: actions-rs/tarpaulin@v0.1 + env: + # GIT_HASH is dummy value. I guess build.rs is skipped in tarpaulin + # execution so this value is required for preventing meta tests from + # panicking + GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 + POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" + SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" with: args: "--all-features --no-fail-fast --workspace=db/db-sqlx-sqlite,. -t 1200" # args: "--all-features --no-fail-fast --workspace=database/db-sqlx-postgres,database/db-sqlx-sqlite,. -t 1200" diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 75ad64d..23c75d7 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -17,7 +17,8 @@ jobs: # - nightly name: ${{ matrix.version }} - x86_64-unknown-linux-gnu - runs-on: ubuntu-latest + runs-on: + ubuntu-latest # services: # postgres: @@ -66,49 +67,45 @@ jobs: && echo "POSTGRES_DATABASE_URL=$POSTGRES_DATABASE_URL" >> $GITHUB_ENV \ && echo "SQLITE_DATABASE_URL=$SQLITE_DATABASE_URL" >> $GITHUB_ENV - - name: launch gitea - timeout-minutes: 10 - run: docker-compose -f docker-compose-dev-deps.yml up --detach - - - name: Install and setup Gitea - timeout-minutes: 10 - run: python ./scripts/gitea.py - - name: build - run: make + run: + make # env: # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" - # - name: build docker images - # if: matrix.version == 'stable' - # run: make docker - # - # - name: publish docker images - # if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart' - # run: make docker-publish - # - # - name: run migrations - # run: make migrate - # env: - # GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" - # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + # - name: build docker images + # if: matrix.version == 'stable' + # run: make docker + # + # - name: publish docker images + # if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart' + # run: make docker-publish + # + - name: run migrations + run: make migrate + env: + GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value + POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" + SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + - name: run tests timeout-minutes: 40 - run: make test - # env: - # GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" - # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + run: + make test + env: + GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value + POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" + SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" - name: generate documentation if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart' - run: make doc - # env: - # GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value - # POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" - # SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" + run: + make doc + env: + GIT_HASH: 8e77345f1597e40c2e266cb4e6dee74888918a61 # dummy value + POSTGRES_DATABASE_URL: "${{ env.POSTGRES_DATABASE_URL }}" + SQLITE_DATABASE_URL: "${{ env.SQLITE_DATABASE_URL }}" - name: Deploy to GitHub Pages if: matrix.version == 'stable' && (github.ref == 'refs/heads/master' || github.event_name == 'push') && github.repository == 'forgeflux-org/starchart' @@ -116,7 +113,8 @@ jobs: with: branch: gh-pages GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - FOLDER: ./target/doc/ + FOLDER: + ./target/doc/ # - name: deploy # if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' && github.repository == 'realaravinth/realaravinth' }}