Merge pull request #12389 from Budibase/fix-opensource-github-actions

Fix opensource github action runs
This commit is contained in:
Adria Navarro 2023-11-17 16:55:27 +00:00 committed by GitHub
commit 4bb52ab463
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 59 deletions

View File

@ -19,50 +19,41 @@ env:
PERSONAL_ACCESS_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
NX_BASE_BRANCH: origin/${{ github.base_ref }}
USE_NX_AFFECTED: ${{ github.event_name == 'pull_request' }}
IS_OSS_CONTRIBUTOR: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase' }}
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- run: yarn lint
build:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
fetch-depth: 0
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
# Run build all the projects
@ -81,24 +72,18 @@ jobs:
test-libraries:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
fetch-depth: 0
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- name: Test
run: |
@ -116,24 +101,18 @@ jobs:
test-worker:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
fetch-depth: 0
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- name: Test worker
run: |
@ -152,24 +131,18 @@ jobs:
test-server:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
fetch-depth: 0
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
with:
fetch-depth: 0
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- name: Test server
run: |
@ -200,7 +173,7 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- name: Test
run: |
@ -213,21 +186,17 @@ jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo and submodules
- name: Checkout repo
uses: actions/checkout@v3
if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == 'Budibase/budibase'
with:
submodules: true
submodules: ${{ env.IS_OSS_CONTRIBUTOR == 'false' }}
token: ${{ secrets.PERSONAL_ACCESS_TOKEN || github.token }}
- name: Checkout repo only
uses: actions/checkout@v3
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != 'Budibase/budibase'
- name: Use Node.js 18.x
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: "yarn"
cache: yarn
- run: yarn --frozen-lockfile
- name: Build packages
run: yarn build --scope @budibase/server --scope @budibase/worker

View File

@ -5,14 +5,7 @@ const { execSync } = require("child_process")
let version = "0.0.0"
const localPro = fs.existsSync("packages/pro/src")
if (!localPro) {
const branchName = execSync("git rev-parse --abbrev-ref HEAD")
.toString()
.trim()
if (branchName === "master") {
version = "latest"
} else {
version = "develop"
}
version = "latest"
}
// Get the list of workspaces with mismatched dependencies