mirror of https://github.com/escalate/hugo-split-theme.git

Felix Boerner
13.39.2024 96b05bb47a993e6d561bfab4b65bc02b4bf77069
ci: reuse workflows
1 files deleted
1 files added
1 files modified
553 ■■■■ changed files
.github/workflows/release.yml 50 ●●●●● patch | view | raw | blame | history
.github/workflows/test.yml 93 ●●●●● patch | view | raw | blame | history
.github/workflows/tests.yml 410 ●●●●● patch | view | raw | blame | history
.github/workflows/release.yml
@@ -2,7 +2,7 @@
'on':
  workflow_run:
    workflows:
      - Tests
      - Test
    branches:
      - master
    types:
@@ -10,51 +10,5 @@
jobs:
  release:
    name: Release
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - name: Checkout
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Check for Go files
        id: check_go
        uses: andstor/file-existence-action@v2
        with:
          files: "**/*.go"
      - name: Fetch all tags
        if: steps.check_go.outputs.files_exists == 'true'
        run: git fetch --force --tags
      - name: Set up Go
        if: steps.check_go.outputs.files_exists == 'true'
        uses: actions/setup-go@v5
        with:
          go-version: 'stable'
      - name: Install GoReleaser
        if: steps.check_go.outputs.files_exists == 'true'
        uses: goreleaser/goreleaser-action@v5
        with:
          install-only: true
      - name: Set up Node.js
        uses: actions/setup-node@v4
        with:
          node-version: 'lts/*'
      - name: Install semantic-release
        run: |
          npm install -g semantic-release conventional-changelog-conventionalcommits
      - name: Create Github release
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        run: |
          if [[ "${{ steps.check_go.outputs.files_exists }}" == "true" ]]; then
            npx -p @semantic-release/changelog -p @semantic-release/exec -p @semantic-release/git semantic-release
          else
            npx semantic-release
          fi
    uses: escalate/github-actions-workflows/.github/workflows/release-go.yml@master
.github/workflows/test.yml
New file
@@ -0,0 +1,93 @@
name: Test
'on':
  push:
    branches:
      - master
  pull_request:
jobs:
  test:
    name: Test
    uses: escalate/github-actions-workflows/.github/workflows/test.yml@master
  hugo:
    name: Hugo
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v4
      - name: Setup Hugo
        uses: peaceiris/actions-hugo@v2
      - name: Build Hugo example site with image
        run: |
          cd tests/exampleSiteWithImage/
          hugo --logLevel=info --baseURL= --themesDir=../../../
      - name: Upload Hugo example site with image
        uses: actions/upload-artifact@v4
        with:
          name: hugo-example-site-with-image
          path: tests/exampleSiteWithImage/public
      - name: Build Hugo example site with video
        run: |
          cd tests/exampleSiteWithVideo/
          hugo --logLevel=info --baseURL= --themesDir=../../../
      - name: Upload Hugo example site with video
        uses: actions/upload-artifact@v4
        with:
          name: hugo-example-site-with-video
          path: tests/exampleSiteWithVideo/public
  sitespeed:
    name: Sitespeed.io
    runs-on: ubuntu-latest
    steps:
      - name: Check out repository
        uses: actions/checkout@v4
      - name: Run sitespeed.io for example site with image in desktop mode
        run: |
          rm --recursive --force tests/exampleSiteWithImage/sitespeed-result
          docker compose --file tests/exampleSiteWithImage/docker-compose.desktop.yml up --exit-code-from sitespeed
      - name: Upload sitespeed.io result for example site with image in desktop mode
        uses: actions/upload-artifact@v4
        with:
          name: sitespeed.io-example-site-with-image-desktop
          path: tests/exampleSiteWithImage/sitespeed-result
      - name: Run sitespeed.io for example site with image in mobile mode
        run: |
          rm --recursive --force tests/exampleSiteWithImage/sitespeed-result
          docker compose --file tests/exampleSiteWithImage/docker-compose.mobile.yml up --exit-code-from sitespeed
      - name: Upload sitespeed.io result for example site with image in mobile mode
        uses: actions/upload-artifact@v4
        with:
          name: sitespeed.io-example-site-with-image-mobile
          path: tests/exampleSiteWithImage/sitespeed-result
      - name: Run sitespeed.io for example site with video in desktop mode
        run: |
          rm --recursive --force tests/exampleSiteWithVideo/sitespeed-result
          docker compose --file tests/exampleSiteWithVideo/docker-compose.desktop.yml up --exit-code-from sitespeed
      - name: Upload sitespeed.io result for example site with video in desktop mode
        uses: actions/upload-artifact@v4
        with:
          name: sitespeed.io-example-site-with-video-desktop
          path: tests/exampleSiteWithVideo/sitespeed-result
      - name: Run sitespeed.io for example site with video in mobile mode
        run: |
          rm --recursive --force tests/exampleSiteWithVideo/sitespeed-result
          docker compose --file tests/exampleSiteWithVideo/docker-compose.mobile.yml up --exit-code-from sitespeed
      - name: Upload sitespeed.io result for example site with video in mobile mode
        uses: actions/upload-artifact@v4
        with:
          name: sitespeed.io-example-site-with-video-mobile
          path: tests/exampleSiteWithVideo/sitespeed-result
.github/workflows/tests.yml
File was deleted