Skip to content

Commit 7cde797

Browse files
committed
Add (icicdr) github ci debug #1
1 parent 61605bb commit 7cde797

1 file changed

Lines changed: 89 additions & 0 deletions

File tree

.github/workflows/null-object.yml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
name: null-object package test, coverage
2+
3+
on:
4+
push:
5+
branches:
6+
# - never # Skip the workflow for debugging purposes;
7+
# - implement/package-ci # NB: For debugging only
8+
- develop
9+
- master
10+
paths:
11+
- ".github/workflows/null-object.yml"
12+
- "readme.md"
13+
- "package.json"
14+
- "src/**"
15+
16+
jobs:
17+
build:
18+
runs-on: ubuntu-latest
19+
permissions: write-all
20+
env:
21+
GITHUB_AUTH_TOKEN: ${{ secrets.GH_AUTH_TOKEN }} # NB: Cannot use 'GITHUB_' prefix
22+
23+
name: Test, publish coverage
24+
25+
steps:
26+
- uses: actions/checkout@v4
27+
28+
- name: Set up Node 20
29+
uses: actions/setup-node@v3
30+
with:
31+
node-version: 20
32+
33+
# Install dependencies and build the package to test in .usage folder
34+
- name: Install dependencies and build the package
35+
run: |
36+
npm install
37+
cd .usage && npm install
38+
cd ../
39+
npm run package:build
40+
41+
- name: Testing the latest build at usage .usage subfolder
42+
working-directory: ./.usage
43+
run: |
44+
npm install
45+
npm run test:usage
46+
47+
- name: Run tests and collect coverage
48+
# NB: See https://app.codecov.io/gh/WhereJuly/60-1-oas-markdown-merger/tests/new
49+
# NB: See https://app.codecov.io/gh/WhereJuly/60-1-oas-markdown-merger/new
50+
run: npm run test:foundation -- --coverage
51+
52+
# - name: Debug - show the ref names
53+
# run: |
54+
# echo ref ${{ github.ref }}
55+
# echo ref name ${{ github.ref_name }}
56+
57+
# I need this step only run for the paths mentioned above AND for only `master` branch;`
58+
# create and push the `<package-name>@v<package-version>` tag to the monorepo
59+
# Take the package name and version from package.json
60+
- name: Create and push tag on master branch only
61+
# NB: For debugging
62+
# if: github.ref_name == 'implement/package-ci'
63+
# if: github.ref_name == 'master'
64+
if: github.ref_name == 'develop'
65+
run: |
66+
# Extract package name and version from package.json
67+
PACKAGE_NAME=$(jq -r .name package.json)
68+
PACKAGE_VERSION=$(jq -r .version package.json)
69+
70+
# Create the tag
71+
# TAG="${PACKAGE_NAME}@${PACKAGE_VERSION}" # Only for monorepos
72+
TAG="${PACKAGE_VERSION}"
73+
git tag $TAG
74+
75+
# Push the tag to the repository
76+
git push origin $TAG
77+
78+
# - name: Push the package subtree to a dedicated repo
79+
# NB: See the code for this step in https://lean-web-enterprise.atlassian.net/browse/DCPLDOAS-68
80+
81+
- name: Upload coverage reports to Codecov
82+
# NB: For debugging
83+
# if: github.ref_name == 'implement/package-ci'
84+
# if: github.ref_name == 'master'
85+
if: github.ref_name == 'develop'
86+
uses: codecov/codecov-action@v5
87+
with:
88+
token: ${{ secrets.CODECOV_TOKEN }}
89+
slug: WhereJuly/68-null-object

0 commit comments

Comments
 (0)