From ab575422a7f11226d3af732830441fa360f7cd13 Mon Sep 17 00:00:00 2001 From: "Takuto NAKAMURA (Kyome)" Date: Wed, 17 Apr 2024 16:49:12 +0900 Subject: [PATCH] Added workflows --- .github/workflows/deploy_docc.yml | 53 +++++++++++++++++++++++++++++++ .github/workflows/test.yml | 38 ++++++++++++++++++++++ 2 files changed, 91 insertions(+) create mode 100644 .github/workflows/deploy_docc.yml create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/deploy_docc.yml b/.github/workflows/deploy_docc.yml new file mode 100644 index 0000000..f33a26a --- /dev/null +++ b/.github/workflows/deploy_docc.yml @@ -0,0 +1,53 @@ +name: Deploy DocC + +on: + workflow_dispatch: + push: + branches: + - main + paths-ignore: + - README.md + - .gitignore + +concurrency: + group: "pages" + cancel-in-progress: true + +jobs: + build: + runs-on: macos-14 + env: + DEVELOPER_DIR: /Applications/Xcode_15.2.app/Contents/Developer + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build DocC + run: | + swift package --allow-writing-to-directory ./docs \ + generate-documentation \ + --target WebUI \ + --disable-indexing \ + --transform-for-static-hosting \ + --output-path ./docs + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: docs + + deploy: + runs-on: ubuntu-latest + needs: build + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..0ec4cfe --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,38 @@ +name: Test + +on: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + unit_test: + name: Unit Test + runs-on: macos-14 + env: + DEVELOPER_DIR: "/Applications/Xcode_15.1.app/Contents/Developer" + timeout-minutes: 30 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Show Xcode Version + run: xcodebuild -version + + - name: Run Tests + run: | + xcodebuild test \ + -project Examples/Examples.xcodeproj \ + -scheme Examples \ + -destination "platform=iOS Simulator,name=iPhone 15,OS=17.2" \ + -resultBundlePath TestResults/result_bundle + + - name: Archive test results + if: success() || failure() + uses: kishikawakatsumi/xcresulttool@2b37f116695328d5e503ac8dadca0f1545a51da4 #v1.7.1 + with: + path: TestResults/result_bundle.xcresult + show-passed-tests: false