feat: add USE_BASIC_LOGIN
option
#677
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: ci | |
env: | |
DATABASE_URL: postgresql://postgres:postgres@localhost:5432/postgres | |
GCP_PROJECT_ID: ${{ secrets.GCP_PROJECT_ID }} | |
GCP_SERVICE_NAME: vanguard | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
lint: | |
name: ⬣ Lint | |
runs-on: ubuntu-latest | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install deps | |
run: pnpm install | |
- name: Lint | |
run: npm run lint | |
test: | |
name: ⚡ Test | |
runs-on: ubuntu-latest | |
services: | |
postgres: | |
image: postgres | |
env: | |
POSTGRES_USER: postgres | |
POSTGRES_PASSWORD: postgres | |
POSTGRES_DB: postgres | |
options: >- | |
--health-cmd pg_isready | |
--health-interval 10s | |
--health-timeout 5s | |
--health-retries 5 | |
ports: | |
- 5432:5432 | |
steps: | |
- name: Cancel Previous Runs | |
uses: styfle/[email protected] | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
- name: Setup Node | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
- name: Install deps | |
run: pnpm install | |
- name: Setup env | |
run: npm run db:migrate:test | |
- name: Run vitest | |
run: npm run test:ci | |
- name: Publish Test Report | |
uses: mikepenz/action-junit-report@v3 | |
if: always() # always run even if the previous step fails | |
with: | |
report_paths: "**/junit.xml" | |
- uses: codecov/codecov-action@v3 | |
name: Publish Codecov Report | |
if: always() # always run even if the previous step fails | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
files: coverage/coverage-final.json | |
# directory: coverage | |
fail_ci_if_error: true | |
verbose: true | |
# build: | |
# name: 🐳 Build | |
# # only on main | |
# if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: 🛑 Cancel Previous Runs | |
# uses: styfle/[email protected] | |
# - name: ⬇️ Checkout repo | |
# uses: actions/checkout@v3 | |
# - name: ⎔ Setup node | |
# uses: actions/setup-node@v3 | |
# with: | |
# node-version: 16 | |
# - name: 📥 Download deps | |
# uses: bahmutov/npm-install@v1 | |
# - name: ⚡️ Build Remix | |
# run: | | |
# npm run build | |
# - name: Archive Production Artifact | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: build | |
# path: build | |
# TODO(dcramer): we'd like to bring build visibility into GH, but its tricky to get right + secure secrets | |
# gcp_build: | |
# name: "🐳 Build" | |
# # only on main | |
# if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: 🛑 Cancel Previous Runs | |
# uses: styfle/[email protected] | |
# - name: ⬇️ Checkout repo | |
# uses: actions/checkout@v3 | |
# - id: "auth" | |
# uses: "google-github-actions/auth@v0" | |
# with: | |
# credentials_json: "${{ secrets.GCP_SA_KEY }}" | |
# # with: | |
# # workload_identity_provider: "projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider" | |
# # service_account: "[email protected]" | |
# # Setup gcloud CLI | |
# - name: Set up Cloud SDK | |
# uses: google-github-actions/setup-gcloud@v0 | |
# with: | |
# install_components: "beta" | |
# # Build and push image to Google Container Registry | |
# - id: "build" | |
# name: Trigger Cloud Build | |
# run: |- | |
# gcloud beta builds triggers run ${{ secrets.GCP_TRIGGER_ID }} --quiet | |
# gcp_deploy: | |
# name: Deploy | |
# # only on main | |
# if: ${{ (github.ref == 'refs/heads/main') && github.event_name == 'push' }} | |
# runs-on: ubuntu-latest | |
# needs: [gcp_build, vitest, lint] | |
# permissions: | |
# contents: "read" | |
# id-token: "write" | |
# steps: | |
# - name: 🛑 Cancel Previous Runs | |
# uses: styfle/[email protected] | |
# - name: ⬇️ Checkout repo | |
# uses: actions/checkout@v3 | |
# - id: "auth" | |
# uses: "google-github-actions/auth@v0" | |
# with: | |
# credentials_json: "${{ secrets.GCP_SA_KEY }}" | |
# # with: | |
# # workload_identity_provider: "projects/123456789/locations/global/workloadIdentityPools/my-pool/providers/my-provider" | |
# # service_account: "[email protected]" | |
# # Activate image on GCR | |
# - id: "deploy" | |
# uses: "google-github-actions/deploy-cloudrun@v0" | |
# with: | |
# service: "${{ env.GCP_SERVICE_NAME }}" | |
# image: "us.gcr.io/${{ env.GCP_PROJECT_ID }}/${{ env.GCP_SERVICE_NAME }}:${{ env.GITHUB_SHA }}" | |
# - name: "Use output" | |
# run: 'curl "${{ steps.deploy.outputs.url }}"' |