Skip to content

Commit

Permalink
ci: prevent duplicate dryrun workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AjBreidenbach committed Jul 1, 2024
1 parent e9574ba commit 15da8a7
Show file tree
Hide file tree
Showing 2 changed files with 116 additions and 76 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/build_test_release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
name: Build, Test, Release

on: [push]

env:
UNFURL_BRANCH: standalone-gui-naive-reload

GCP_DNS_ZONE: deploythis.io
AWS_DNS_ZONE: opencloudservices.net

MAIL_USERNAME: [email protected]
MAIL_PASSWORD: ocPC2cnGkQsz35I
SMTP_HOST: mailu.untrusted.me

AWS_ACCESS_KEY_ID: foobarbaz
AWS_SECRET_ACCESS_KEY: asldfjkasldkjalqweioptuqpeortiu
AWS_DEFAULT_REGION: eu-central-1

ARM_CLIENT_ID: 2b03ea39-628d-4443-96ec-535bc8b374eb
ARM_TENANT_ID: 1211e508-10ae-48e9-9591-74b82d108762
ARM_SUBSCRIPTION_ID: 2a4d88e0-165e-422b-bb41-aa4f1461e581
ARM_CLIENT_SECRET: asldfjkasldkjalqweioptuqpeortiu
AZURE_RESOURCE_GROUP: example-resources
AZURE_SUBNET: default
AZURE_VIRTUAL_NETWORK: example-network

GOOGLE_APPLICATION_CREDENTIALS: testing-shared/fixtures/service-account.json

DIGITALOCEAN_TOKEN: asldfjkasldkjalqweioptuqpeortiu

FAIL_FAST_ENABLED: true
CY_COMMAND_TIMEOUT: 30000
TEST_VERSIONS: v2
UNFURL_TEST_TMPDIR: tmp

jobs:
build_and_test:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install yarn dependencies
run: npm i -g yarn && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
# TODO add back ufsv-patch -- --runInBand
- name: Run unit tests
run: yarn test packages -- --runInBand
- name: Compile
run: yarn build
- name: Install unfurl
run: git clone --recurse-submodules --branch $UNFURL_BRANCH --single-branch --depth 1 https://github.com/onecommons/unfurl $HOME/unfurl; pip install -e $HOME/unfurl
- name: Integration test
run: yarn integration-test run --namespace onecommons/blueprints -- -e GENERATE_SUBDOMAINS=true --browser chrome -s cypress/e2e/blueprints/aws__baserow__baserow.cy.js
- name: pkill
run: pkill unfurl || /bin/true
- name: Integration test (staging upstream)
run: yarn integration-test run --namespace onecommons/blueprints -- -e GENERATE_SUBDOMAINS=true --browser chrome -s cypress/e2e/blueprints/aws__baserow__baserow.cy.js
env:
OC_INVITE_CODE: ${{ secrets.OC_INVITE_CODE }}
UNFURL_PACKAGE_RULES: 'gitlab.com/* staging.unfurl.cloud/* unfurl.cloud/* staging.unfurl.cloud/*'
UNFURL_CLOUD_SERVER: https://staging.unfurl.cloud
- name: Upload Cypress screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload dashboard
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: dashboard
path: ${{ env.UNFURL_TEST_TMPDIR }}/ufsv
- name: Upload unfurl server log
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: unfurl-server-log
path: ${{ env.UNFURL_TEST_TMPDIR }}/unfurl.log
- name: Create release artifacts
if: startsWith(github.ref, 'refs/tags/')
run: tar -czvf unfurl-gui-dist.tar.gz dist
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: unfurl-gui-dist
path: unfurl-gui-dist.tar.gz
- name: Trigger dryrun
# avoid running twice when we're pushing a tag
if: "! startsWith(github.ref, 'refs/tags/')"
uses: benc-uk/workflow-dispatch@v1
with:
workflow: dryrun.yml
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build_and_test
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: unfurl-gui-dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: unfurl-gui-dist.tar.gz
81 changes: 5 additions & 76 deletions .github/workflows/node.js.yml → .github/workflows/dryrun.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
name: CI

on: [push]
name: Dryrun Extra
on:
workflow_dispatch:

# copied from build_and_test.yml
env:
UNFURL_BRANCH: standalone-gui-naive-reload

Expand Down Expand Up @@ -34,81 +36,8 @@ env:
UNFURL_TEST_TMPDIR: tmp

jobs:
build:
name: Test & Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- name: Install yarn dependencies
run: npm i -g yarn && YARN_ENABLE_IMMUTABLE_INSTALLS=false yarn install
# TODO add back ufsv-patch -- --runInBand
- name: Run unit tests
run: yarn test packages -- --runInBand
- name: Compile
run: yarn build
- name: Install unfurl
run: git clone --recurse-submodules --branch $UNFURL_BRANCH --single-branch --depth 1 https://github.com/onecommons/unfurl $HOME/unfurl; pip install -e $HOME/unfurl
- name: Integration test
run: yarn integration-test run --namespace onecommons/blueprints -- -e GENERATE_SUBDOMAINS=true --browser chrome -s cypress/e2e/blueprints/aws__baserow__baserow.cy.js
- name: pkill
run: pkill unfurl || /bin/true
- name: Integration test (staging upstream)
run: yarn integration-test run --namespace onecommons/blueprints -- -e GENERATE_SUBDOMAINS=true --browser chrome -s cypress/e2e/blueprints/aws__baserow__baserow.cy.js
env:
OC_INVITE_CODE: ${{ secrets.OC_INVITE_CODE }}
UNFURL_PACKAGE_RULES: 'gitlab.com/* staging.unfurl.cloud/* unfurl.cloud/* staging.unfurl.cloud/*'
UNFURL_CLOUD_SERVER: https://staging.unfurl.cloud
- name: Upload Cypress screenshots
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: cypress-screenshots
path: cypress/screenshots
- name: Upload dashboard
if: ${{ failure() }}
uses: actions/upload-artifact@v2
with:
name: dashboard
path: ${{ env.UNFURL_TEST_TMPDIR }}/ufsv
- name: Upload unfurl server log
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
name: unfurl-server-log
path: ${{ env.UNFURL_TEST_TMPDIR }}/unfurl.log
- name: Create release artifacts
if: startsWith(github.ref, 'refs/tags/')
run: tar -czvf unfurl-gui-dist.tar.gz dist
- name: Upload dist
uses: actions/upload-artifact@v2
with:
name: unfurl-gui-dist
path: unfurl-gui-dist.tar.gz
release:
name: Release
if: startsWith(github.ref, 'refs/tags/')
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Download build artifact
uses: actions/download-artifact@v2
with:
name: unfurl-gui-dist
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: unfurl-gui-dist.tar.gz

# TODO some yaml merging or smth (GitHub doesn't support yaml anchors)
# This could leverage .gitlab/ci-tests.yaml and have automated documentation
dryrun_a:
name: Dryrun A
needs: build
env:
SPEC_GLOBS: aws* az*
SPEC_SKIP_GLOBS: '*container-webapp* *nestedcloud* *draft aws__baserow*' # we already ran baserow
Expand Down Expand Up @@ -147,7 +76,7 @@ jobs:

dryrun_b:
name: Dryrun B
needs: build
if: "github.event.workflow_run.conclusion == 'success' && startsWith(github.ref, 'refs/heads/')"
env:
SPEC_GLOBS: gcp* do*
SPEC_SKIP_GLOBS: '*container-webapp* *nestedcloud* *draft aws__baserow*' # we already ran baserow
Expand Down

0 comments on commit 15da8a7

Please sign in to comment.