diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..af00988 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,57 @@ +# ===----------------------------------------------------------------------=== +# +# This source file is part of the Amiibo Service open source project +# +# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors +# Licensed under Apache license v2.0 +# +# See LICENSE for license information +# See CONTRIBUTORS for the list of Amiibo Service project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +# ===----------------------------------------------------------------------=== + +name: CI + +on: + push: + branches: [main] + pull_request: + branches: [main] + +permissions: + contents: read + +concurrency: + group: ci-${{ github.ref }} + cancel-in-progress: true + +jobs: + test: + name: Build and test + runs-on: macos-latest + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Select Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Show toolchain + run: swift --version + + - name: Cache build + uses: actions/cache@v4 + with: + path: .build + key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }} + restore-keys: spm-${{ runner.os }}- + + - name: Build + run: make lib-build + + - name: Test + run: make lib-test diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 0000000..6a6a8c8 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,77 @@ +# ===----------------------------------------------------------------------=== +# +# This source file is part of the Amiibo Service open source project +# +# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors +# Licensed under Apache license v2.0 +# +# See LICENSE for license information +# See CONTRIBUTORS for the list of Amiibo Service project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +# ===----------------------------------------------------------------------=== + +name: Documentation + +on: + push: + branches: [main] + pull_request: + branches: [main] + workflow_dispatch: + +permissions: + contents: read + +concurrency: + group: docs-${{ github.ref }} + cancel-in-progress: true + +jobs: + build: + name: Build documentation + runs-on: macos-latest + steps: + - name: Check out + uses: actions/checkout@v4 + + # Pinned: swift-docc-plugin 1.5.0 fails to launch its tools under Xcode 27 ("Bad CPU type in executable"). + - name: Select Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '26' + + - name: Show toolchain + run: swift --version + + - name: Cache build + uses: actions/cache@v4 + with: + path: .build + key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }} + restore-keys: spm-${{ runner.os }}- + + - name: Generate + run: make doc-generate-github + + - name: Upload + uses: actions/upload-pages-artifact@v3 + with: + path: docs + + deploy: + name: Deploy to GitHub Pages + if: github.event_name != 'pull_request' + needs: build + runs-on: ubuntu-latest + permissions: + pages: write + id-token: write + environment: + name: github-pages + url: ${{ steps.deploy.outputs.page_url }} + steps: + - name: Deploy + id: deploy + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/live-tests.yml b/.github/workflows/live-tests.yml new file mode 100644 index 0000000..aa946ff --- /dev/null +++ b/.github/workflows/live-tests.yml @@ -0,0 +1,52 @@ +# ===----------------------------------------------------------------------=== +# +# This source file is part of the Amiibo Service open source project +# +# Copyright (c) 2026 Röck+Cöde VoF. and the Amiibo Service project authors +# Licensed under Apache license v2.0 +# +# See LICENSE for license information +# See CONTRIBUTORS for the list of Amiibo Service project authors +# +# SPDX-License-Identifier: Apache-2.0 +# +# ===----------------------------------------------------------------------=== + +name: Live tests + +on: + schedule: + # Every Monday at 06:00 UTC. + - cron: '0 6 * * 1' + workflow_dispatch: + +permissions: + contents: read + +jobs: + test: + name: Test against the live service + runs-on: macos-latest + steps: + - name: Check out + uses: actions/checkout@v4 + + - name: Select Xcode + uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: latest-stable + + - name: Show toolchain + run: swift --version + + - name: Cache build + uses: actions/cache@v4 + with: + path: .build + key: spm-${{ runner.os }}-${{ hashFiles('Package.resolved') }} + restore-keys: spm-${{ runner.os }}- + + - name: Test + run: make lib-test + env: + AMIIBO_LIVE_TESTS: '1' diff --git a/.gitignore b/.gitignore index 2d0a4ca..0efd6ab 100644 --- a/.gitignore +++ b/.gitignore @@ -48,4 +48,5 @@ Packages/ .vscode # DocC documentation -*.doccarchive \ No newline at end of file +*.doccarchive +docs/ \ No newline at end of file diff --git a/README.md b/README.md index ea2d76e..798cb14 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,6 @@ [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frock-n-code%2Famiibo-service%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/rock-n-code/amiibo-service) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Frock-n-code%2Famiibo-service%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/rock-n-code/amiibo-service) +[![](https://github.com/rock-n-code/amiibo-service/actions/workflows/ci.yml/badge.svg)](https://github.com/rock-n-code/amiibo-service/actions/workflows/ci.yml) # Amiibo Service