diff --git a/.github/workflows/pr-main.yaml b/.github/workflows/pr-main.yaml new file mode 100644 index 0000000..0a9e954 --- /dev/null +++ b/.github/workflows/pr-main.yaml @@ -0,0 +1,35 @@ +name: PR main - Lint, Build, Test +run-name: Lint, Build, Test + +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + lint-build-test: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4.1.1 + with: + fetch-depth: 2 + + - name: Install Node.js v20.10 + uses: actions/setup-node@v4.0.1 + with: + node-version: '20.10' + + - name: Install Bun + run: npm i -g bun && bun --version + + - name: Install dependencies + run: bun i && cd templates/express-advanced && bun i + + - name: Lint + run: bun lint + + - name: Build + run: | + bun run build && cd templates/express-advanced && bun run build diff --git a/.github/workflows/push-any-build-3-jobs.yaml b/.github/workflows/push-any-build-3-jobs.yaml deleted file mode 100644 index c6aba21..0000000 --- a/.github/workflows/push-any-build-3-jobs.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# 1) Checkoput, install Node.js, Turborepo CLI, deps and Lint -# 2a) Build -# 2b) Test - -name: Push to any - 3 Jobs -run-name: Lint, Build, Test - -on: - pull_request: - branches: - - main - workflow_dispatch: - -# env: - # To use Remote Caching, uncomment the next lines and follow the steps below. - -jobs: - checkout_install_lint: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@v4.1.1 - with: - fetch-depth: 2 - - name: Install Node.js v20.10 - uses: actions/setup-node@v4.0.1 - with: - node-version: '20.10' - # - name: Get node version - # id: node - # run: | - # echo "::set-output name=version::$(node -v)" - # - name: Get node_modules cache - # uses: actions/cache@v4.0.0 - # # id: node_modules - # with: - # path: | - # **/node_modules - # # Adding node version as cache key - # key: ${{ runner.os }}-node_modules-${{ hashFiles('**/bun.lockb') }}-${{ steps.node.outputs.version }} - - - name: Install Bun - run: npm i -g bun && bun --version - - name: Install dependencies - run: bun i && cd templates/express-advanced && bun i - - name: Lint - run: bun lint - - build: - runs-on: ubuntu-latest - needs: checkout_install_lint - steps: - - name: Checkout code - uses: actions/checkout@v4.1.1 - with: - fetch-depth: 2 - - name: Install Node.js v20.10 - uses: actions/setup-node@v4.0.1 - with: - node-version: '20.10' - # - name: Get node_modules cache - # uses: actions/cache@v4.0.0 - # # id: node_modules - # with: - # path: | - # **/node_modules - # # Adding node version as cache key - # key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} - - - name: Install Bun - run: npm i -g bun && bun --version - - name: Install dependencies - run: bun i && cd templates/express-advanced && bun i - - name: Build - run: | - bun run build && cd templates/express-advanced && bun run build - - # test: - # runs-on: ubuntu-latest - # needs: checkout_install_lint - # steps: - # - name: Checkout code - # uses: actions/checkout@v4.1.1 - # with: - # fetch-depth: 2 - # - name: Install Node.js v20.10 - # uses: actions/setup-node@v4.0.1 - # with: - # node-version: '20.10' - # - name: Get node_modules cache - # uses: actions/cache@v4.0.0 - # # id: node_modules - # with: - # path: | - # **/node_modules - # # Adding node version as cache key - # key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}-${{ steps.node.outputs.version }} - # - name: Test - # run: | - # yarn test