chore: load env vars where relevant

This commit is contained in:
Aravinth Manivannan 2022-04-13 12:19:42 +05:30
parent 89cdee765a
commit ec97f096de
Signed by: realaravinth
GPG key ID: AD9F0F08E855ED88
2 changed files with 46 additions and 51 deletions

View file

@ -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"

View file

@ -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,16 +67,9 @@ 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 }}"
@ -88,27 +82,30 @@ jobs:
# 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 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' }}