Skip to content

Commit

Permalink
ci(build): add centralized workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Gijsdeman committed Nov 2, 2024
1 parent 900da50 commit b5cfea4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 78 deletions.
68 changes: 11 additions & 57 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,60 +17,14 @@ permissions:
statuses: read

jobs:
lint-and-format:
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- name: Cache and restore node_modules
id: cache-node
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./yarn.lock') }}
- run: yarn
if: steps.cache-node.outputs.cache-hit != 'true'
- run: yarn lint
- run: yarn format
test:
needs: [ lint-and-format ]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Start Planka
run: docker compose -f "docker-compose.yml" up -d --build
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
- run: yarn
- run: yarn test
- name: Stop Planka
if: always()
run: docker compose -f "docker-compose.yml" down
build:
needs: [ test ]
runs-on: ubuntu-latest
container:
image: node:20
steps:
- uses: actions/checkout@v4
- name: Cache and restore node_modules
id: cache-node
uses: actions/cache@v4
with:
path: ./node_modules
key: ${{ runner.os }}-node-${{ hashFiles('./yarn.lock') }}
- run: yarn
if: steps.cache-node.outputs.cache-hit != 'true'
- run: yarn build
- name: "Compress out folder"
run: tar -zcvf dist.tar.gz dist/
- name: "Upload /out of build"
uses: actions/upload-artifact@v4
with:
name: build
path: dist.tar.gz
retention-days: 1
build-and-lint:
uses: GEWIS/actions/.github/workflows/[email protected]
with:
node-version: "20.x"
package-manager: "yarn"
prepare-command: "docker compose -f 'docker-compose.yml' up -d --build"
cleanup-command: "docker compose -f 'docker-compose.yml' down"
step-lint: true
step-format: true
step-test: true
step-build: true
22 changes: 1 addition & 21 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,4 @@ concurrency:

jobs:
versioning:
runs-on: ubuntu-latest

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

outputs:
next_version: ${{ steps.semantic.outputs.new_release_version }}

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: .

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v4
id: semantic
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
uses: GEWIS/actions/.github/workflows/[email protected]

0 comments on commit b5cfea4

Please sign in to comment.