Skip to content

Commit

Permalink
ci: uses hoverkraft-tech/ci-github-nodejs
Browse files Browse the repository at this point in the history
Signed-off-by: Emilien Escalle <emilien.escalle@escemi.com>
  • Loading branch information
neilime committed Feb 9, 2024
1 parent 933673a commit 86fff4c
Show file tree
Hide file tree
Showing 8 changed files with 135 additions and 60 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/__shared-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Shared - Continuous Integration for common tasks

on:
workflow_call:

jobs:
continuous-integration:
# FIXME: This is a workaround for having workflow actions. See https://github.com/orgs/community/discussions/38659
permissions:
id-token: write
contents: read
security-events: write
uses: hoverkraft-tech/ci-github-nodejs/.github/workflows/continuous-integration.yml@0.2.1
with:
build: '{"artifact":"packages/*/dist"}'
58 changes: 0 additions & 58 deletions .github/workflows/continuous-integration.yml

This file was deleted.

15 changes: 15 additions & 0 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Main - Continuous Integration

on:
push:
branches: [main]
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
21 changes: 21 additions & 0 deletions .github/workflows/need-fix-to-issue.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Need fix to Issue

on:
push:
branches:
- main
workflow_dispatch:
inputs:
manual-commit-ref:
description: "The SHA of the commit to get the diff for"
required: true
manual-base-ref:
description: "By default, the commit entered above is compared to the one directly before it; to go back further, enter an earlier SHA here"
required: false

jobs:
main:
uses: hoverkraft-tech/ci-github-common/.github/workflows/need-fix-to-issue.yml@0.11.2
with:
manual-commit-ref: ${{ inputs.manual-commit-ref }}
manual-base-ref: ${{ inputs.manual-base-ref }}
15 changes: 15 additions & 0 deletions .github/workflows/pull-request-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Pull request - Continuous Integration

on:
pull_request:
branches: [main]
merge_group:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml
67 changes: 67 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: 🚀 Release

on:
workflow_dispatch:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
ci:
name: Continuous Integration
uses: ./.github/workflows/__shared-ci.yml

npm-packages:
name: 📦 Publish NPM packages
needs: ci
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hoverkraft-tech/ci-github-nodejs/actions/setup-node@0.2.1

- uses: actions/download-artifact@v4
with:
name: build
path: /

- env:
NPM_TOKEN: ${{ secrets.NODE_AUTH_TOKEN }}
GH_TOKEN: ${{ secrets.GH_PRIVATE_ACCESS_TOKEN }}
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
git config --local user.email "${{ github.actor }}@users.noreply.github.com"
git config --local user.name "${{ github.actor }}"
yarn lerna publish --conventional-commits --create-release github --yes
documentation:
name: 📚 Publish documentation
needs: ci
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- run: |
mkdir -p documentation
echo "theme: jekyll-theme-cayman" > documentation/_config.yml
cp README.md documentation/index.md
- uses: actions/configure-pages@v4
- uses: actions/jekyll-build-pages@v1
with:
source: documentation/
destination: documentation/_site
- uses: actions/upload-pages-artifact@v3
with:
path: documentation/_site

- name: 🌐 Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion packages/core/src/core.spec.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ describe(`E2E - ${packageToTest}`, () => {

testProjectTmpDir = join(__dirname, "../../../node_modules/.cache/", basename(testProjectDir));
if (!existsSync(testProjectTmpDir)) {
mkdirSync(testProjectTmpDir);
mkdirSync(testProjectTmpDir, { recursive: true });
await createTestTypescriptProjectDir(testProjectTmpDir);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/react.spec.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ describe(`E2E - ${packageToTest}`, () => {

testProjectTmpDir = join(__dirname, "../../../node_modules/.cache/", basename(testProjectDir));
if (!existsSync(testProjectTmpDir)) {
mkdirSync(testProjectTmpDir);
mkdirSync(testProjectTmpDir, { recursive: true });
await createTestReactProjectDir(testProjectTmpDir);
}

Expand Down

0 comments on commit 86fff4c

Please sign in to comment.