Skip to content

Commit

Permalink
ci: add runners for prs and push to main
Browse files Browse the repository at this point in the history
fix: fix issue with ci/cd

chore: fix failing tests
  • Loading branch information
mainawycliffe committed Nov 9, 2024
1 parent 3d4b945 commit 3dab6d0
Show file tree
Hide file tree
Showing 3 changed files with 104 additions and 14 deletions.
34 changes: 34 additions & 0 deletions .firebase/logs/vsce-debug.log
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,37 @@
[info] [Firebase Plugin] Checked firebase-tools, is up to date!
[debug] [2024-11-09T09:03:14.555Z] 'fdc build' failed with error: Unable to build your Data Connect schema and connectors (exit code 1): E1109 12:03:14.550688 41269 cmd.go:41] Error loading data connect config: could not find dataconnect.yaml in `/Users/mainawycliffe/projects/nx-toolkits/dataconnect`
{"metadata":{"emulator":{"name":"dataconnect"},"message":"'fdc build' failed with error: Unable to build your Data Connect schema and connectors (exit code 1): E1109 12:03:14.550688 41269 cmd.go:41] Error loading data connect config: could not find dataconnect.yaml in `/Users/mainawycliffe/projects/nx-toolkits/dataconnect`\n"}}
[debug] [2024-11-09T09:45:51.381Z] [Firebase Plugin] Value of process.env.MONOSPACE_ENV: undefined
[debug] [2024-11-09T09:45:51.382Z] [Firebase Plugin] requireAuthWrapper
[debug] [2024-11-09T09:45:51.383Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-11-09T09:45:51.383Z] > authorizing via signed-in user ([email protected])
[debug] [2024-11-09T09:45:51.384Z] Checked if tokens are valid: false, expires at: 1731143948931
[debug] [2024-11-09T09:45:51.384Z] Checked if tokens are valid: false, expires at: 1731143948931
[debug] [2024-11-09T09:45:51.384Z] > refreshing access token with scopes: []
[debug] [2024-11-09T09:45:51.385Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[debug] [2024-11-09T09:45:51.385Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[debug] [2024-11-09T09:45:51.387Z] [Firebase Plugin] Value of process.env.MONOSPACE_ENV: undefined
[debug] [2024-11-09T09:45:51.387Z] [Firebase Plugin] requireAuthWrapper
[debug] [2024-11-09T09:45:51.387Z] > command requires scopes: ["email","openid","https://www.googleapis.com/auth/cloudplatformprojects.readonly","https://www.googleapis.com/auth/firebase","https://www.googleapis.com/auth/cloud-platform"]
[debug] [2024-11-09T09:45:51.388Z] > authorizing via signed-in user ([email protected])
[debug] [2024-11-09T09:45:51.388Z] Checked if tokens are valid: false, expires at: 1731143948931
[debug] [2024-11-09T09:45:51.388Z] Checked if tokens are valid: false, expires at: 1731143948931
[debug] [2024-11-09T09:45:51.388Z] > refreshing access token with scopes: []
[debug] [2024-11-09T09:45:51.388Z] >>> [apiv2][query] POST https://www.googleapis.com/oauth2/v3/token [none]
[debug] [2024-11-09T09:45:51.388Z] >>> [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[debug] [2024-11-09T09:45:51.721Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 200
[debug] [2024-11-09T09:45:51.721Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[debug] [2024-11-09T09:45:51.734Z] [Firebase Plugin] User found: [email protected]
[info] [Firebase Plugin] (Core:Project) New user detected, fetching projects
[debug] [2024-11-09T09:45:51.734Z] Checked if tokens are valid: true, expires at: 1731149150722
[debug] [2024-11-09T09:45:51.735Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2024-11-09T09:45:51.735Z] <<< [apiv2][status] POST https://www.googleapis.com/oauth2/v3/token 200
[debug] [2024-11-09T09:45:51.735Z] <<< [apiv2][body] POST https://www.googleapis.com/oauth2/v3/token [omitted]
[debug] [2024-11-09T09:45:51.744Z] [Firebase Plugin] User found: [email protected]
[info] [Firebase Plugin] (Core:Project) New user detected, fetching projects
[debug] [2024-11-09T09:45:51.744Z] Checked if tokens are valid: true, expires at: 1731149150736
[debug] [2024-11-09T09:45:51.744Z] >>> [apiv2][query] GET https://firebase.googleapis.com/v1beta1/projects pageSize=1000
[debug] [2024-11-09T09:45:52.452Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 200
[debug] [2024-11-09T09:45:52.453Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
[debug] [2024-11-09T09:45:52.966Z] <<< [apiv2][status] GET https://firebase.googleapis.com/v1beta1/projects 200
[debug] [2024-11-09T09:45:52.966Z] <<< [apiv2][body] GET https://firebase.googleapis.com/v1beta1/projects [omitted]
16 changes: 2 additions & 14 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@ name: publish to npm
on:
push:
tags:
- "firebase@*"
- "testing-library@*"
- 'firebase@*'
- 'testing-library@*'

jobs:
build:
runs-on: ubuntu-latest
steps:

# We want to get the tag name without the @version suffix, this is our
# package name
- uses: actions/github-script@v6
Expand Down Expand Up @@ -64,14 +63,3 @@ jobs:

- name: Build
run: pnpm nx run ${{ steps.get-tag-name.outputs.result }}:build

- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: dist/packages/${{ steps.get-tag-name.outputs.result }}/*.*
bodyFile: "packages/${{ steps.get-tag-name.outputs.result }}/CHANGELOG.md"

- name: npm publish
run: npm publish dist/packages/${{ steps.get-tag-name.outputs.result }} --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
68 changes: 68 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: publish to npm

on:
push:
# main:
branches:
- main
pull_request:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
steps:
# We want to get the tag name without the @version suffix, this is our
# package name
- uses: actions/github-script@v6
id: get-tag-name
env:
GIT_TAG_NAME: ${{ github.ref_name }}
with:
result-encoding: string
script: return process.env.GIT_TAG_NAME.split('@')[0]

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/

# - uses: nrwl/nx-set-shas@v3
# id: nx-toolkit-nx-set-shas
# with:
# workflow-id: 'publish firebase generator'

- uses: pnpm/action-setup@v2
name: Install pnpm
id: pnpm-install
with:
version: 7
run_install: false

- name: Get pnpm store directory
id: pnpm-cache
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Lint
run: pnpm affected -t lint

- name: Test
run: pnpm nx affected -t test

- name: Build
run: pnpm nx affected -t build

0 comments on commit 3dab6d0

Please sign in to comment.