From d1e49d15e250b45d9a98d9246489abbba306296b Mon Sep 17 00:00:00 2001 From: SHOO Date: Fri, 8 Nov 2024 23:43:05 +0900 Subject: [PATCH] Fix CI --- .github/workflows/main.yml | 29 +++-- .github/workflows/pr.yml | 28 ++--- .github/workflows/release.yml | 195 ++++++---------------------------- .github/workflows/status.yml | 52 ++++----- .gitignore | 13 +++ 5 files changed, 100 insertions(+), 217 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6f1f0fb..b981971 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,7 +45,7 @@ jobs: # name: test-${OS}-${ARCH}-${COMPILER} # runs-on: ${OS} # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v4 # - name: Install D compiler # uses: dlang-community/setup-dlang@v1 # with: @@ -82,7 +82,7 @@ jobs: name: test-windows-x86-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -96,7 +96,7 @@ jobs: name: test-windows-x86-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -120,7 +120,7 @@ jobs: name: test-windows-x86_64-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -142,7 +142,7 @@ jobs: name: test-windows-x86_64-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -164,7 +164,7 @@ jobs: name: test-windows-x86_64-ldc-master runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -187,7 +187,7 @@ jobs: name: test-linux-x86-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -195,7 +195,7 @@ jobs: - name: Install gcc-multilib run: | sudo apt update - sudo apt install gcc-multilib + sudo apt install -y gcc-multilib - name: Run unit tests run: rdmd ./.github/workflows/runner.d -a=x86 --mode=unit-test - name: Build tests @@ -215,7 +215,7 @@ jobs: name: test-linux-x86_64-dmd-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -238,7 +238,7 @@ jobs: name: test-linux-x86_64-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -260,7 +260,7 @@ jobs: name: test-linux-x86_64-dmd-master runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -299,7 +299,7 @@ jobs: name: test-macos-x86_64-dmd-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -322,7 +322,7 @@ jobs: name: test-macos-x86_64-ldc-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -348,7 +348,7 @@ jobs: needs: [test-windows-x86-dmd-latest, test-windows-x86-ldc-latest, test-windows-x86_64-dmd-latest, test-windows-x86_64-ldc-latest, test-windows-x86_64-ldc-master, test-linux-x86-ldc-latest, test-linux-x86_64-dmd-latest, test-linux-x86_64-ldc-latest, test-linux-x86_64-dmd-master, test-macos-x86_64-dmd-latest, test-macos-x86_64-ldc-latest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download coverage result uses: actions/download-artifact@v4 with: @@ -389,7 +389,6 @@ jobs: with: github_token: ${{ secrets.GITHUB_TOKEN }} allow_empty_commit: false - publish_dir: docs publish_branch: gh-pages user_name: GitHub Actions Bot diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index 485b22a..ad1f232 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -42,7 +42,7 @@ jobs: # name: test-${OS}-${ARCH}-${COMPILER} # runs-on: ${OS} # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v4 # - name: Install D compiler # uses: dlang-community/setup-dlang@v1 # with: @@ -89,7 +89,7 @@ jobs: name: test-windows-x86-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -103,7 +103,7 @@ jobs: name: test-windows-x86-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -135,7 +135,7 @@ jobs: name: test-windows-x86_64-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -157,7 +157,7 @@ jobs: name: test-windows-x86_64-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -187,7 +187,7 @@ jobs: name: test-windows-x86_64-ldc-master runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -213,7 +213,7 @@ jobs: name: test-linux-x86-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -221,7 +221,7 @@ jobs: - name: Install gcc-multilib run: | sudo apt update - sudo apt install gcc-multilib + sudo apt install -y gcc-multilib - name: Run unit tests run: rdmd ./.github/workflows/runner.d -a=x86 --mode=unit-test - name: Build tests @@ -244,7 +244,7 @@ jobs: name: test-linux-x86_64-dmd-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -270,7 +270,7 @@ jobs: name: test-linux-x86_64-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -302,7 +302,7 @@ jobs: name: test-linux-x86_64-dmd-master runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -343,7 +343,7 @@ jobs: name: test-macos-x86_64-dmd-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -366,7 +366,7 @@ jobs: name: test-macos-x86_64-ldc-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -400,7 +400,7 @@ jobs: needs: [test-windows-x86-dmd-latest, test-windows-x86-ldc-latest, test-windows-x86_64-dmd-latest, test-windows-x86_64-ldc-latest, test-windows-x86_64-ldc-master, test-linux-x86-ldc-latest, test-linux-x86_64-dmd-latest, test-linux-x86_64-ldc-latest, test-linux-x86_64-dmd-master, test-macos-x86_64-dmd-latest, test-macos-x86_64-ldc-latest] runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Download coverage result uses: actions/download-artifact@v4 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9326446..10edabe 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,188 +2,59 @@ name: Release on: push: tags: - - v* + - v*.*.* jobs: # No. OS ARCH COMPILER - # 2. Windows x86 ldc - # 6. Windows x86_64 ldc # 14. Ubuntu x86_64 ldc - # 22. macOS x86_64 ldc - - # No. OS ARCH COMPILER - # 2. Windows x86 ldc - create-windows-x86: - name: create-windows-x86 - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Install D compiler - uses: dlang-community/setup-dlang@v1 - with: - compiler: ldc-latest - - name: Build binary - run: dub build -a=x86 -b=release - - name: Create archive - id: create_archive - run: rdmd ./.github/workflows/runner.d -a=x86 --mode=create-archive - - name: Upload created archive - uses: actions/upload-artifact@v4 - with: - name: windows-x86-binary - path: ${{ steps.create_archive.outputs.ARCNAME }} - - # No. OS ARCH COMPILER - # 6. Windows x86_64 ldc - create-windows-x86_64: - name: create-windows-x86_64 - runs-on: windows-latest - steps: - - uses: actions/checkout@v2 - - name: Install D compiler - uses: dlang-community/setup-dlang@v1 - with: - compiler: ldc-latest - - name: Build binary - run: dub build -a=x86_64 -b=release - - name: Create archive - id: create_archive - run: rdmd ./.github/workflows/runner.d -a=x86_64 --mode=create-archive - - name: Upload created archive - uses: actions/upload-artifact@v4 - with: - name: windows-x86_64-binary - path: ${{ steps.create_archive.outputs.ARCNAME }} - - # No. OS ARCH COMPILER - # 14. Ubuntu x86_64 ldc - create-linux-x86_64: - name: create-linux-x86_64 + create-document: + name: create-document runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: compiler: ldc-latest - name: Build bianry - run: dub build -a=x86_64 -b=release - - name: Create archive - id: create_archive - run: rdmd ./.github/workflows/runner.d -a=x86_64 --mode=create-archive + run: dub build -a=x86_64 -b=release -c=default - name: Generate document - run: rdmd ./.github/workflows/runner.d -a=x86_64 --mode=generate-document - - name: Upload created archive - uses: actions/upload-artifact@v4 - with: - name: linux-x86_64-binary - path: ${{ steps.create_archive.outputs.ARCNAME }} + run: | + (which dot >/dev/null 2>&1) || (sudo apt-get update && sudo apt-get install -y graphviz) + rdmd ./scripts/runner.d -a=x86_64 --mode=generate-document + # dub build -b=ddeps - name: Upload generated pages uses: actions/upload-artifact@v4 with: name: docs path: docs - # No. OS ARCH COMPILER - # 22. macOS x86_64 ldc - create-macos-x86_64: - name: create-macos-x86_64 - runs-on: macos-12 - steps: - - uses: actions/checkout@v2 - - name: Install D compiler - uses: dlang-community/setup-dlang@v1 - with: - compiler: ldc-latest - - name: Build binary - run: dub build -a=x86_64 -b=release - - name: Create archive - id: create_archive - run: rdmd ./.github/workflows/runner.d -a=x86_64 --mode=create-archive - - name: Upload created archive - uses: actions/upload-artifact@v4 - with: - name: osx-x86_64-binary - path: ${{ steps.create_archive.outputs.ARCNAME }} - # Deploy Pages - create-release: - name: create-release - needs: [create-windows-x86, create-windows-x86_64, create-linux-x86_64, create-macos-x86_64] + deploy-pages: + name: deploy-pages + needs: create-document runs-on: ubuntu-latest steps: - - name: Get Names - id: get_names - run: | - echo ::set-output name=TAGNAME::${GITHUB_REF#refs/tags/} - echo ::set-output name=PROJNAME::${GITHUB_REPOSITORY#$GITHUB_ACTOR/} - - name: Download windows-x86-binary + - uses: actions/checkout@v3 + with: + ref: gh-pages + # バージョン値確認 + - name: Set version + id: set_ver + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} + # ドキュメントのアーティファクトダウンロード + - name: Download generated pages uses: actions/download-artifact@v4 with: - name: windows-x86-binary - path: ./ - - name: Download windows-x86_64-binary - uses: actions/download-artifact@v4 - with: - name: windows-x86_64-binary - path: ./ - - name: Download linux-x86_64-binary - uses: actions/download-artifact@v4 - with: - name: linux-x86_64-binary - path: ./ - - name: Download osx-x86_64-binary - uses: actions/download-artifact@v4 - with: - name: osx-x86_64-binary - path: ./ - - name: Create Release - id: create_release - uses: actions/create-release@v1.0.0 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - tag_name: ${{ github.ref }} - release_name: Release ${{ github.ref }} - draft: false - prerelease: false - - name: Upload Release Asset Win32 - id: upload-release-asset-win32 - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-windows-x86.zip - asset_name: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-windows-x86.zip - asset_content_type: application/zip - - name: Upload Release Asset Win64 - id: upload-release-asset-win64 - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-windows-x86_64.zip - asset_name: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-windows-x86_64.zip - asset_content_type: application/zip - - name: Upload Release Asset Linux - id: upload-release-asset-linux - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-linux-x86_64.tar.gz - asset_name: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-linux-x86_64.tar.gz - asset_content_type: application/x-gzip - - name: Upload Release Asset OSX - id: upload-release-asset-osx - uses: actions/upload-release-asset@v1.0.1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ steps.create_release.outputs.upload_url }} - asset_path: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-macos-x86_64.tar.gz - asset_name: ${{ steps.get_names.outputs.PROJNAME }}-${{ steps.get_names.outputs.TAGNAME }}-macos-x86_64.tar.gz - asset_content_type: application/x-gzip + name: docs + path: ${{ steps.set_ver.outputs.VERSION }} + # キュメントをGitHub Pagesへデプロイ + - name: Deploy pages + uses: peaceiris/actions-gh-pages@v4 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + allow_empty_commit: false + publish_dir: . + publish_branch: gh-pages + user_name: GitHub Actions Bot + user_email: <> diff --git a/.github/workflows/status.yml b/.github/workflows/status.yml index da6492b..295c431 100644 --- a/.github/workflows/status.yml +++ b/.github/workflows/status.yml @@ -45,9 +45,9 @@ jobs: # name: test-${OS}-${ARCH}-${COMPILER} # runs-on: ${OS} # steps: - # - uses: actions/checkout@v2 + # - uses: actions/checkout@v4 # with: - # ref: master + # ref: main # - name: Install D compiler # uses: dlang-community/setup-dlang@v1 # with: @@ -84,9 +84,9 @@ jobs: name: test-windows-x86-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -100,9 +100,9 @@ jobs: name: test-windows-x86-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -126,9 +126,9 @@ jobs: name: test-windows-x86_64-dmd-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -150,9 +150,9 @@ jobs: name: test-windows-x86_64-ldc-latest runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -174,9 +174,9 @@ jobs: name: test-windows-x86_64-ldc-master runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -199,9 +199,9 @@ jobs: name: test-linux-x86-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -209,7 +209,7 @@ jobs: - name: Install gcc-multilib run: | sudo apt update - sudo apt install gcc-multilib + sudo apt install -y gcc-multilib - name: Run unit tests run: rdmd ./.github/workflows/runner.d -a=x86 --mode=unit-test - name: Build tests @@ -229,9 +229,9 @@ jobs: name: test-linux-x86_64-dmd-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -254,9 +254,9 @@ jobs: name: test-linux-x86_64-ldc-latest runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -278,9 +278,9 @@ jobs: name: test-linux-x86_64-dmd-master runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -319,9 +319,9 @@ jobs: name: test-macos-x86_64-dmd-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: @@ -333,7 +333,7 @@ jobs: - name: Upload coverage result uses: actions/upload-artifact@v4 with: - name: coverage-osx + name: coverage-macos12 path: .cov include-hidden-files: true @@ -344,9 +344,9 @@ jobs: name: test-macos-x86_64-ldc-latest runs-on: macos-12 steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: - ref: master + ref: main - name: Install D compiler uses: dlang-community/setup-dlang@v1 with: diff --git a/.gitignore b/.gitignore index 29ab113..83a11cc 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ bsky.a bsky.lib bsky-test-* *.exe +*.dll *.pdb *.o *.obj @@ -19,12 +20,23 @@ bsky-test-* *.sqlite *.csv *.log +/*.jpg +/*.png +/*.webp +/*.mp4 +/*.txt +/*.sh +/*.bat + +# for workflows +!/.github # for tests !/tests/*/dub.json # for examples !/examples/*/dub.json +!/examples/.common # for unittest data source !/tests/.ut-data_source @@ -34,3 +46,4 @@ bsky-test-* !/tests/.ut-data_source/*.jpg !/tests/.ut-data_source/*.txt !/tests/.ut-data_source/*.csv +!/tests/.ut-data_source/*.mp4