Skip to content

Commit c231804

Browse files
committed
ci: New CI/CD process
1 parent 3bbda39 commit c231804

File tree

2 files changed

+28
-25
lines changed

2 files changed

+28
-25
lines changed

.github/workflows/pr.yml

+11-11
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ jobs:
99
secrets:
1010
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
1111

12-
e2e-test:
13-
needs: [test]
14-
uses: ./.github/workflows/e2e-test.yaml
15-
secrets:
16-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
17-
18-
build:
19-
needs: [test, e2e-test]
20-
uses: ./.github/workflows/build.yml
21-
secrets:
22-
NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
12+
# e2e-test:
13+
# needs: [test]
14+
# uses: ./.github/workflows/e2e-test.yaml
15+
# secrets:
16+
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}
17+
#
18+
# build:
19+
# needs: [test, e2e-test]
20+
# uses: ./.github/workflows/build.yml
21+
# secrets:
22+
# NX_CLOUD_ACCESS_TOKEN: ${{ secrets.NX_CLOUD_ACCESS_TOKEN }}

.github/workflows/test.yml

+17-14
Original file line numberDiff line numberDiff line change
@@ -26,24 +26,27 @@ jobs:
2626
- name: Setup Node.js
2727
uses: ./.github/actions
2828

29-
- name: Determine base branch for NX affected
30-
id: set-base
29+
- name: Debug mainBranch value
30+
run: |
31+
echo "Input mainBranch: '${{ github.event.inputs.mainBranch }}'"
32+
33+
- name: Determine base for NX affected (if not master)
34+
if: ${{ github.event.inputs.mainBranch != 'master' }}
3135
shell: bash
3236
run: |
33-
if [ "${{ github.event.inputs.mainBranch }}" = "master" ]; then
34-
echo "base=master" >> $GITHUB_OUTPUT
35-
echo "Using base branch 'master'"
36-
else
37-
LAST_TAG=$(git describe --tags --abbrev=0)
38-
LAST_TAG_HASH=$(git rev-parse "$LAST_TAG")
39-
echo "base=$LAST_TAG_HASH" >> $GITHUB_OUTPUT
40-
echo "Using last tag hash: $LAST_TAG_HASH"
41-
fi
42-
43-
- name: Derive appropriate SHAs for base and head for `nx affected` commands
37+
LAST_TAG=$(git describe --tags --abbrev=0)
38+
LAST_TAG_HASH=$(git rev-parse "$LAST_TAG")
39+
CURRENT_COMMIT=$(git rev-parse HEAD)
40+
echo "Using last tag hash as NX_BASE: $LAST_TAG_HASH"
41+
echo "Using current commit as NX_HEAD: $CURRENT_COMMIT"
42+
echo "NX_BASE=$LAST_TAG_HASH" >> $GITHUB_ENV
43+
echo "NX_HEAD=$CURRENT_COMMIT" >> $GITHUB_ENV
44+
45+
- name: Determine base for NX affected (if master)
46+
if: ${{ github.event.inputs.mainBranch == 'master' }}
4447
uses: nrwl/nx-set-shas@v4
4548
with:
46-
main-branch-name: ${{ steps.set-base.outputs.base }}
49+
main-branch-name: ${{ github.event.inputs.mainBranch }}
4750

4851
- name: Test
4952
run: npx nx affected --target=test --parallel=3 --passWithNoTests --exclude='*,!tag:type:publish'

0 commit comments

Comments
 (0)