Skip to content

Commit

Permalink
chore(ci): Migrate to GitHub Actions (#136)
Browse files Browse the repository at this point in the history
  • Loading branch information
JoseLion authored Aug 28, 2023
1 parent 4de5555 commit 2367f5d
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 198 deletions.
179 changes: 0 additions & 179 deletions .circleci/config.yml

This file was deleted.

34 changes: 34 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
---
name: CI

on:
push:
workflow_call:

concurrency:
group: ci-${{ github.ref_name }}
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: oracle
java-version: 20
check-latest: true
cache: gradle
- run: ./gradlew compileGroovy compileTestGroovy compileE2eGroovy
- run: ./gradlew codenarcMain codenarcTest codenarcE2e
- run: ./gradlew test
- run: ./gradlew e2e
- run: ./gradlew build
- run: ./gradlew jacocoTestReport
- name: Upload report
run: |
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -Z -t ${{ secrets.CODECOV_TOKEN }}
3 changes: 2 additions & 1 deletion .github/workflows/owner-approve.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Auto approve for owner

on:
Expand All @@ -9,6 +10,6 @@ jobs:
if: github.actor == github.repository_owner
runs-on: ubuntu-latest
steps:
- uses: hmarr/auto-approve-action@v2.1.0
- uses: hmarr/auto-approve-action@v3
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
26 changes: 9 additions & 17 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
---

name: Pages

on:
push:
branches: [release]
workflow_call:
workflow_dispatch:

permissions:
contents: read
Expand All @@ -13,26 +12,20 @@ permissions:

concurrency:
group: pages
cancel-in-progress: true
cancel-in-progress: false

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Pages
uses: actions/configure-pages@v2

- name: Build with Jekyll
uses: actions/jekyll-build-pages@v1
- uses: actions/checkout@v3
- uses: actions/configure-pages@v3
- uses: actions/jekyll-build-pages@v1
with:
source: ./
destination: ./_site
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
- uses: actions/upload-pages-artifact@v2

deploy:
environment:
Expand All @@ -42,6 +35,5 @@ jobs:
needs: build

steps:
- uses: actions/deploy-pages@v1

...
- uses: actions/deploy-pages@v2
id: deployment
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
name: Release

on:
workflow_dispatch:

concurrency:
group: release
cancel-in-progress: true

jobs:
build:
uses: ./.github/workflows/ci.yml

deploy:
runs-on: ubuntu-latest
needs: build

permissions:
contents: write
issues: write
pull-requests: write
id-token: write

steps:
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: oracle
java-version: 20
check-latest: true
cache: gradle
- uses: actions/setup-node@v3
with:
node-version-file: .nvmrc
cache: yarn
- name: Provision
run: |
sed -i "s/{GRADLE_PUBLISH_KEY}/${{ secrets.GRADLE_PUBLISH_KEY }}/g" gradle.properties
sed -i "s/{GRADLE_PUBLISH_SECRET}/${{ secrets.GRADLE_PUBLISH_SECRET }}/g" gradle.properties
- run: ./gradlew build
- run: yarn install --immutable
- run: yarn release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

pages:
uses: ./.github/workflows/pages.yml
needs: deploy
4 changes: 3 additions & 1 deletion .releaserc.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
{
"$schema": "https://json.schemastore.org/semantic-release",
"branches": ["release"],
"branches": [
"main"
],
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
Expand Down

0 comments on commit 2367f5d

Please sign in to comment.