Skip to content

Commit

Permalink
fix: correct reusable workflow (#127)
Browse files Browse the repository at this point in the history
* fix: correct reusable workflow

* chore: multi-platform build is a reusable workflow

* fix: remove 'needs: check' for build
  • Loading branch information
SgtPooki committed Jun 22, 2022
1 parent e7e606f commit e52f066
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 29 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/build-all-platforms.yml
@@ -0,0 +1,21 @@
name: Build and publish compliance reports
on:
# This workflow should be required for 'test & maybe release' to succeed
# see https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
workflow_call:

jobs:
build:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present build
21 changes: 10 additions & 11 deletions .github/workflows/build-and-publish-reports.yml
@@ -1,7 +1,7 @@
name: Build and publish compliance reports
on:
# This workflow should be required for 'test & maybe release' to succeed
# see https://docs.github.com/en/actions/using-workflows/reusing-workflows
# see https://docs.github.com/en/actions/using-workflows/reusing-workflows#creating-a-reusable-workflow
workflow_call:

workflow_dispatch:
Expand All @@ -24,16 +24,15 @@ on:
pull_request:
branches: [ main ]
jobs:
checkout:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
- uses: ipfs/aegir/actions/cache-node-modules@master

build:
uses: ./.github/workflows/build-all-platforms.yml
with:
secrets: inherit

check-pinata-compliance:
runs-on: ubuntu-latest
needs: [checkout]
needs: [build]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand All @@ -55,7 +54,7 @@ jobs:

check-estuary-compliance:
runs-on: ubuntu-latest
needs: [checkout]
needs: [build]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand All @@ -77,7 +76,7 @@ jobs:

check-nft-dot-storage-compliance:
runs-on: ubuntu-latest
needs: [checkout]
needs: [build]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand All @@ -99,7 +98,7 @@ jobs:

check-web3-dot-storage-compliance:
runs-on: ubuntu-latest
needs: [checkout]
needs: [build]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3
Expand Down
25 changes: 7 additions & 18 deletions .github/workflows/js-test-and-release.yml
Expand Up @@ -22,28 +22,17 @@ jobs:

build:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
fail-fast: false
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present build
uses: ./.github/workflows/build-all-platforms.yml
with:
secrets: inherit

# see https://docs.github.com/en/actions/using-workflows/reusing-workflows
# see https://docs.github.com/en/actions/using-workflows/reusing-workflows#calling-a-reusable-workflow
run_reports:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
steps:
- uses: ./.github/workflows/build-and-publish-reports.yml
with:
secrets: inherit
uses: ./.github/workflows/build-and-publish-reports.yml
with:
secrets: inherit

release:
needs: [check, build, run_reports]
Expand Down

0 comments on commit e52f066

Please sign in to comment.