Skip to content

Commit

Permalink
fix: workflow concurrency
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Paraskos committed Aug 18, 2023
1 parent a441ea0 commit ce4a70d
Showing 1 changed file with 91 additions and 69 deletions.
160 changes: 91 additions & 69 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,78 +4,87 @@ on:
push:
branches: [main]
pull_request:

jobs:
checkout:
runs-on: ubuntu-latest
env:
NODE_VERSION: 16.x
jobs:
lint:
env:
CI: true
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16.x
node-version: $NODE_VERSION
cache: npm
- run: npm ci

lint:
runs-on: ubuntu-latest
needs:
- checkout

steps:
- run: npm run lint

parser:
runs-on: ubuntu-latest
needs:
- lint

env:
CI: true
SUB_PROJECT: parser
steps:
- name: Install parser dependencies
working-directory: parser
run: npm install

- name: Build parser
working-directory: parser
run: npm run build
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
working-directory: $SUB_PROJECT
- run: npm run build
working-directory: $SUB_PROJECT

webview:
runs-on: ubuntu-latest
needs:
- lint

env:
CI: true
SUB_PROJECT: webviews
steps:
- run: npm install
working-directory: webview

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
working-directory: $SUB_PROJECT
- run: npm run build
working-directory: webview
working-directory: $SUB_PROJECT

client:
runs-on: ubuntu-latest
needs:
- lint

env:
CI: true
SUB_PROJECT: client
steps:
- run: npm install
working-directory: client

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
working-directory: $SUB_PROJECT
- run: npm run build
working-directory: client
working-directory: $SUB_PROJECT

server:
needs:
- lint
- parser
runs-on: ubuntu-latest

env:
CI: true
SUB_PROJECT: server
steps:
- run: npm install
working-directory: server

- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
working-directory: $SUB_PROJECT
- run: npm run build
working-directory: server
working-directory: $SUB_PROJECT

test:
runs-on: ubuntu-latest
Expand All @@ -85,37 +94,50 @@ jobs:
- webview
- client
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
- run: npm run test

publish:
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Package
run: |
npx vsce package
env:
CI: true
- name: Automatic Semantic Release
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Visual Studio Marketplace
if: steps.semantic.outputs.new_release_published == 'true'
run: |
npx vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to OpenVSX
if: steps.semantic.outputs.new_release_published == 'true'
run: |
npx ovsx publish
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: $NODE_VERSION
cache: npm
- run: npm ci
- name: Package
run: |
npm run build
npx vsce package
env:
CI: true
- name: Automatic Semantic Release
uses: cycjimmy/semantic-release-action@v3
id: semantic
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
branch: main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Publish to Visual Studio Marketplace
if: steps.semantic.outputs.new_release_published == 'true'
run: |
npx vsce publish
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
- name: Publish to OpenVSX
if: steps.semantic.outputs.new_release_published == 'true'
run: |
npx ovsx publish
env:
OVSX_PAT: ${{ secrets.OVSX_PAT }}

0 comments on commit ce4a70d

Please sign in to comment.