Skip to content

Commit

Permalink
[affected][newfeature]: initial commit of affected, pragma action wit…
Browse files Browse the repository at this point in the history
…h tests (#6)

[affected][newfeature]: initial commit of affected, pragma action with tests (#6)
  • Loading branch information
leblancmeneses authored Dec 10, 2024
1 parent 7b36795 commit eb878e9
Show file tree
Hide file tree
Showing 46 changed files with 9,470 additions and 9,192 deletions.
65 changes: 49 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ concurrency:
jobs:
main:
runs-on: ubuntu-latest
env:
NX_CLOUD: false
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -27,42 +29,73 @@ jobs:
# The "--stop-agents-after" is optional, but allows idle agents to shut down once the "build" targets have been requested
# - run: npx nx-cloud start-ci-run --distribute-on="5 linux-medium-js" --stop-agents-after="build"

# Cache node_modules
- uses: actions/setup-node@v4
with:
node-version: 20
cache: 'npm'

- run: npm ci
- name: install dependencies
run: |
npm install -g pnpm
pnpm install --frozen-lockfile
- uses: nrwl/nx-set-shas@v4

# Prepend any command with "nx-cloud record --" to record its logs to Nx Cloud
# - run: npx nx-cloud record -- echo Hello World
# - run: npx nx affected -t lint test build
- run: npx nx affected -t lint build

- run: npx nx run version-autopilot:build:production

- name: commit changes for npx nx run-many -t build
run: git diff --exit-code -- ./dist

- name: example in README.md task
- name: example version-autopilot
id: version-autopilot
uses: ./dist/apps/version-autopilot
with:
major: 0
minor: 0
shift: 50 # remove if this is a brand new application. Otherwise, use this to match your current version.

- name: example in README.md output
- name: example version-autopilot output
run: |
echo "github.run_number: ${{ github.run_number }}"
echo "version_autopilot_string_recommended: ${{ steps.version-autopilot.outputs.version_autopilot_string_recommended }}"
echo "version_autopilot_string: ${{ steps.version-autopilot.outputs.version_autopilot_string }}"
echo "version_autopilot_code: ${{ steps.version-autopilot.outputs.version_autopilot_code }}"
version-autopilot-tests:
if: |
!failure() && !cancelled() && github.event_name == 'pull_request'
needs: [main]
uses: ./.github/workflows/tests.version-autopilot.yml
- name: example pragma
id: pragma
uses: ./dist/apps/pragma
with:
variables: |
lint-appname-ui = 'skip'
force = false
deploy = "${{ github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/prod' }}"
- name: example affected
id: affected
uses: ./dist/apps/affected
with:
rules: |
ci: './github/workflows/ci.yml';
[affected](./apps/affected): './apps/affected/**' './dist/apps/affected/**' ci;
[version-autopilot](./apps/version-autopilot): './apps/version-autopilot/**' './dist/apps/version-autopilot/**' ci;
[pragma](./apps/pragma): './apps/pragma/**' './dist/apps/pragma/**' ci;
e2e: './e2e/**' affected version-autopilot !'**/*.md';
- name: e2e tests
if: ${{ !failure() && !cancelled() && fromJson(steps.affected.outputs.affected).changes.e2e }}
run: npx nx run e2e:e2e

- name: build affected
if: ${{ !failure() && !cancelled() && fromJson(steps.affected.outputs.affected).changes.affected }}
run: npx nx run affected:build:production

- name: build version-autopilot
if: ${{ !failure() && !cancelled() && fromJson(steps.affected.outputs.affected).changes.version-autopilot }}
run: npx nx run version-autopilot:build:production

- name: build pragma
if: ${{ !failure() && !cancelled() && fromJson(steps.affected.outputs.affected).changes.pragma }}
run: npx nx run pragma:build:production

- name: assert dist is deterministic
run: git diff --exit-code -- ./dist

148 changes: 0 additions & 148 deletions .github/workflows/tests.version-autopilot.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
tmp
/out-tsc


# dependencies
node_modules

Expand Down
Loading

0 comments on commit eb878e9

Please sign in to comment.