ci: added artifact collection to main workflow #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Main CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
# pull_request: | ||
jobs: | ||
main: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
node-version: 20 | ||
cache: 'npm' | ||
- run: npx nx-cloud start-ci-run | ||
- run: yarn install --frozen-lockfile | ||
- uses: nrwl/nx-set-shas@v3 | ||
- run: npx nx-cloud record -- nx format:check | ||
- run: npx nx run-many -t lint test build --no-agents | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
# Name of the artifact to upload. | ||
# Optional. Default is 'artifact' | ||
name: &artifactName dist-and-coverage-artifact | ||
# A file, directory or wildcard pattern that describes what to upload | ||
# Required. | ||
path: | | ||
dist | ||
coverage | ||
package.json | ||
# main: | ||
# name: Nx Cloud - Main Job | ||
# uses: nrwl/ci/.github/workflows/[email protected] | ||
# secrets: | ||
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# with: | ||
# main-branch-name: main | ||
# number-of-agents: 3 | ||
# init-commands: | | ||
# yarn nx-cloud start-ci-run --stop-agents-after="build" --agent-count=3 | ||
# parallel-commands: | | ||
# yarn nx-cloud record -- yarn nx format:check | ||
# parallel-commands-on-agents: | | ||
# yarn nx lint harbor-master | ||
# yarn nx test harbor-master --ci --codeCoverage | ||
# yarn nx build harbor-master | ||
# artifacts-path: | | ||
# dist | ||
# coverage | ||
# package.json | ||
# artifacts-name: dist-and-coverage-artifacts | ||
# node-version: '20' | ||
# agents: | ||
# name: Nx Cloud - Agents | ||
# uses: nrwl/ci/.github/workflows/[email protected] | ||
# secrets: | ||
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }} | ||
# NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
# with: | ||
# number-of-agents: 3 | ||
# node-version: '20' | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: | ||
- main | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: dist-and-coverage-artifacts | ||
- name: Use Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '20' | ||
- run: yarn install --frozen-lockfile | ||
- name: Release | ||
run: | | ||
npx semantic-release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} |