Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Subgraph GitHub actions #2053

Subgraph GitHub actions

Subgraph GitHub actions #2053

Workflow file for this run

name: Schema
on:
push:
pull_request:
jobs:
generate_and_publish_schema:
# Deduplicate jobs from pull requests and branch pushes within the same repo.
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name != github.repository
strategy:
matrix:
service:
- name: compound_library
publish: true
- name: compound_soaking
publish: true
- name: crystal_library
publish: true
- name: soakdb_sync
publish: false
- name: pin_packing
publish: false
- name: targeting
publish: false
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v4.1.1
- name: Install stable toolchain
uses: actions-rs/toolchain@v1.0.7
with:
toolchain: stable
default: true
- name: Cache Rust Build
uses: Swatinem/rust-cache@v2.7.3
- name: Generate Schema
uses: actions-rs/cargo@v1.0.3
with:
command: run
args: >
--package ${{ matrix.service.name }}
--manifest-path backend/Cargo.toml
schema
--path ${{ matrix.service.name }}.graphql
- name: Upload Schema Artifact
uses: actions/upload-artifact@v4.3.1
with:
name: ${{ matrix.service.name }}.graphql
path: ${{ matrix.service.name }}.graphql
- name: Debug APOLLO_KEY
run: echo "APOLLO_KEY=$APOLLO_KEY"
env:
APOLLO_KEY: ${{ secrets.APOLLO_KEY }}
- name: check subgraph schema
if: ${{ matrix.service.publish }}
uses: danielsinclair/rover-setup@v1
with:
args: subgraph check xchemlab@current
--schema ${{ matrix.service.name }}.graphql
--name ${{ matrix.service.name }}
env:
APOLLO_KEY: ${{ secrets.APOLLO_KEY }}
- name: publish subgraph schema
if: ${{ matrix.service.publish == true }}
uses: danielsinclair/rover-setup@v1
with:
args: subgraph publish xchemlab@current
--routing-url http://${{ matrix.service.name }}:80
--schema ${{ matrix.service.name }}.graphql
--name ${{ matrix.service.name }}
env:
APOLLO_KEY: ${{ secrets.APOLLO_KEY }}