chore: fix publishing an pr workflows
This commit is contained in:
58
.github/workflows/publish.yml
vendored
58
.github/workflows/publish.yml
vendored
@@ -5,7 +5,8 @@ on:
|
|||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
Build:
|
build:
|
||||||
|
name: Build & Test
|
||||||
if: "${{ contains(github.event.head_commit.message, 'chore(release): publish') == false }}"
|
if: "${{ contains(github.event.head_commit.message, 'chore(release): publish') == false }}"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
@@ -14,14 +15,12 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
token: ${{ secrets.CI_PAT_TOKEN }}
|
token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Node
|
- name: Set up Node
|
||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
registry-url: 'https://registry.npmjs.org'
|
registry-url: 'https://registry.npmjs.org'
|
||||||
node-version-file: '.nvmrc'
|
node-version-file: '.nvmrc'
|
||||||
cache: 'yarn'
|
cache: 'yarn'
|
||||||
|
|
||||||
- name: Setup git config
|
- name: Setup git config
|
||||||
run: |
|
run: |
|
||||||
git config --global user.name "standardci"
|
git config --global user.name "standardci"
|
||||||
@@ -33,22 +32,22 @@ jobs:
|
|||||||
passphrase: ${{ secrets.PASSPHRASE }}
|
passphrase: ${{ secrets.PASSPHRASE }}
|
||||||
git_user_signingkey: true
|
git_user_signingkey: true
|
||||||
git_commit_gpgsign: true
|
git_commit_gpgsign: true
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build:all
|
run: yarn build:all
|
||||||
|
|
||||||
- name: ESLint
|
- name: ESLint
|
||||||
run: yarn lint
|
run: yarn lint
|
||||||
|
|
||||||
- name: Build Android
|
- name: Build Android
|
||||||
run: yarn android:bundle
|
run: yarn android:bundle
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: yarn test
|
run: yarn test
|
||||||
|
|
||||||
|
build-docker:
|
||||||
|
name: Build Docker Image
|
||||||
|
if: "${{ contains(github.event.head_commit.message, 'chore(release): publish') == false }}"
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@@ -62,7 +61,12 @@ jobs:
|
|||||||
yarn docker build @standardnotes/snjs -t standardnotes/snjs:${{ github.sha }}
|
yarn docker build @standardnotes/snjs -t standardnotes/snjs:${{ github.sha }}
|
||||||
docker push standardnotes/snjs:${{ github.sha }}
|
docker push standardnotes/snjs:${{ github.sha }}
|
||||||
|
|
||||||
- name: Run E2E test suite
|
e2e-base:
|
||||||
|
name: E2E Base Test Suite
|
||||||
|
needs: build-docker
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run E2E base test suite
|
||||||
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
||||||
uses: convictional/trigger-workflow-and-wait@master
|
uses: convictional/trigger-workflow-and-wait@master
|
||||||
with:
|
with:
|
||||||
@@ -71,19 +75,51 @@ jobs:
|
|||||||
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
workflow_file_name: e2e-test-suite.yml
|
workflow_file_name: e2e-test-suite.yml
|
||||||
wait_interval: 30
|
wait_interval: 30
|
||||||
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "base", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
||||||
propagate_failure: true
|
propagate_failure: true
|
||||||
trigger_workflow: true
|
trigger_workflow: true
|
||||||
wait_workflow: true
|
wait_workflow: true
|
||||||
|
|
||||||
|
e2e-vaults:
|
||||||
|
name: E2E Vaults Test Suite
|
||||||
|
needs: build-docker
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run E2E vaults test suite
|
||||||
|
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
||||||
|
uses: convictional/trigger-workflow-and-wait@master
|
||||||
|
with:
|
||||||
|
owner: standardnotes
|
||||||
|
repo: server
|
||||||
|
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
|
workflow_file_name: e2e-test-suite.yml
|
||||||
|
wait_interval: 30
|
||||||
|
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
||||||
|
propagate_failure: true
|
||||||
|
trigger_workflow: true
|
||||||
|
wait_workflow: true
|
||||||
|
|
||||||
|
publish:
|
||||||
|
name: Publish to NPM
|
||||||
|
needs: [e2e-base, e2e-vaults]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install --immutable
|
||||||
|
- name: Build
|
||||||
|
run: yarn build:all
|
||||||
- name: Bump version
|
- name: Bump version
|
||||||
run: yarn release:prod
|
run: yarn release:prod
|
||||||
|
|
||||||
- name: Publish
|
- name: Publish
|
||||||
run: yarn publish:prod
|
run: yarn publish:prod
|
||||||
env:
|
env:
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
|
NODE_AUTH_TOKEN: ${{ secrets.CI_NPM_TOKEN }}
|
||||||
|
|
||||||
|
publish-docker:
|
||||||
|
name: Publish to Docker Hub
|
||||||
|
needs: [e2e-base, e2e-vaults]
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
- name: Publish SNJS Docker image as stable
|
- name: Publish SNJS Docker image as stable
|
||||||
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
if: "${{ contains(github.event.head_commit.message, 'skip e2e') == false }}"
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
36
.github/workflows/snjs.pr.yml
vendored
36
.github/workflows/snjs.pr.yml
vendored
@@ -1,4 +1,4 @@
|
|||||||
name: SNJS PR — E2E Tests
|
name: SNJS PR — E2E Tests
|
||||||
|
|
||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
@@ -29,6 +29,14 @@ jobs:
|
|||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
- name: Build
|
- name: Build
|
||||||
run: yarn build:snjs
|
run: yarn build:snjs
|
||||||
|
- name: ESLint
|
||||||
|
run: yarn lint
|
||||||
|
- name: Test
|
||||||
|
run: yarn test
|
||||||
|
|
||||||
|
build-docker:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
- name: Login to Docker Hub
|
- name: Login to Docker Hub
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
with:
|
with:
|
||||||
@@ -40,6 +48,12 @@ jobs:
|
|||||||
docker push standardnotes/snjs:${{ github.sha }}
|
docker push standardnotes/snjs:${{ github.sha }}
|
||||||
docker tag standardnotes/snjs:${{ github.sha }} standardnotes/snjs:test
|
docker tag standardnotes/snjs:${{ github.sha }} standardnotes/snjs:test
|
||||||
docker push standardnotes/snjs:test
|
docker push standardnotes/snjs:test
|
||||||
|
|
||||||
|
e2e-base:
|
||||||
|
name: E2E Base Test Suite
|
||||||
|
needs: build-docker
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
- name: Run E2E test suite
|
- name: Run E2E test suite
|
||||||
uses: convictional/trigger-workflow-and-wait@master
|
uses: convictional/trigger-workflow-and-wait@master
|
||||||
with:
|
with:
|
||||||
@@ -48,7 +62,25 @@ jobs:
|
|||||||
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
workflow_file_name: e2e-test-suite.yml
|
workflow_file_name: e2e-test-suite.yml
|
||||||
wait_interval: 30
|
wait_interval: 30
|
||||||
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "base", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
||||||
|
propagate_failure: true
|
||||||
|
trigger_workflow: true
|
||||||
|
wait_workflow: true
|
||||||
|
|
||||||
|
e2e-vaults:
|
||||||
|
name: E2E Vaults Test Suite
|
||||||
|
needs: build-docker
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Run E2E vaults test suite
|
||||||
|
uses: convictional/trigger-workflow-and-wait@master
|
||||||
|
with:
|
||||||
|
owner: standardnotes
|
||||||
|
repo: server
|
||||||
|
github_token: ${{ secrets.CI_PAT_TOKEN }}
|
||||||
|
workflow_file_name: e2e-test-suite.yml
|
||||||
|
wait_interval: 30
|
||||||
|
client_payload: '{"snjs_image_tag": "${{ github.sha }}", "suite": "vaults", "author": "${{ github.actor }}", "ref_name": "app:${{ github.ref }}"}'
|
||||||
propagate_failure: true
|
propagate_failure: true
|
||||||
trigger_workflow: true
|
trigger_workflow: true
|
||||||
wait_workflow: true
|
wait_workflow: true
|
||||||
|
|||||||
Reference in New Issue
Block a user