diff --git a/.github/workflows/ci-documentation-noop.yml b/.github/workflows/ci-documentation-noop.yml new file mode 100644 index 00000000..e25fcc83 --- /dev/null +++ b/.github/workflows/ci-documentation-noop.yml @@ -0,0 +1,22 @@ +name: Documentation CI + +on: + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/ci-documentation.yml" + - "**/*.swift" + - "**/*.docc/**/*.md" + +concurrency: + group: "ci-documentation-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + build-documentation: + name: Build Documentation + runs-on: ubuntu-latest + steps: + - name: Build + run: 'echo "No build required"' diff --git a/.github/workflows/ci-documentation.yml b/.github/workflows/ci-documentation.yml new file mode 100644 index 00000000..c1ef12a2 --- /dev/null +++ b/.github/workflows/ci-documentation.yml @@ -0,0 +1,28 @@ +name: Documentation CI + +on: + pull_request: + branches: + - main + paths: + - ".github/workflows/ci-documentation.yml" + - "**/*.swift" + - "**/*.docc/**/*.md" + workflow_dispatch: + +concurrency: + group: "ci-documentation-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + build-documentation: + name: Build Documentation + runs-on: ubuntu-latest + env: + SWIFTCI_DOCC: 1 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Build + run: swift package generate-documentation --product TMDb diff --git a/.github/workflows/ci-noop.yml b/.github/workflows/ci-noop.yml new file mode 100644 index 00000000..ef875274 --- /dev/null +++ b/.github/workflows/ci-noop.yml @@ -0,0 +1,48 @@ +name: CI + +on: + push: + branches: + - main + paths-ignore: + - ".github/workflows/ci.yml" + - "**/*.swift" + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/ci.yml" + - "**/*.swift" + +concurrency: + group: "ci-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + build-test: + name: Build and Test + runs-on: ubuntu-latest + steps: + - name: Build + run: 'echo "No build required"' + + build-and-test-platforms: + name: Build and Test (${{ matrix.name }}) + runs-on: ubuntu-latest + continue-on-error: true + strategy: + matrix: + include: + - name: iOS + - name: watchOS + - name: tvOS + steps: + - name: Build + run: 'echo "No build required"' + + build-test-linux: + name: Build and Test (Linux) + runs-on: ubuntu-latest + steps: + - name: Build + run: 'echo "No build required"' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index be018378..7db30038 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -4,9 +4,15 @@ on: push: branches: - main + paths: + - ".github/workflows/ci.yml" + - "**/*.swift" pull_request: branches: - main + paths: + - ".github/workflows/ci.yml" + - "**/*.swift" workflow_dispatch: concurrency: @@ -72,15 +78,3 @@ jobs: - name: Build for Release run: swift build -c release -Xswiftc -warnings-as-errors - - build-documentation: - name: Build Documentation - runs-on: macos-13 - env: - SWIFTCI_DOCC: 1 - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Build - run: swift package generate-documentation --product TMDb diff --git a/.github/workflows/codeql-noop.yml b/.github/workflows/codeql-noop.yml new file mode 100644 index 00000000..7fef63dc --- /dev/null +++ b/.github/workflows/codeql-noop.yml @@ -0,0 +1,21 @@ +name: CodeQL + +on: + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/codeql.yml" + - "**/*.swift" + +concurrency: + group: "codeql-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + steps: + - name: Perform CodeQL Analysis + run: 'echo "No analysis required"' diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index a6394146..2983a989 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -1,4 +1,4 @@ -name: "CodeQL" +name: CodeQL on: push: @@ -7,6 +7,9 @@ on: pull_request: branches: - main + paths: + - ".github/workflows/codeql.yml" + - "**/*.swift" schedule: # Every Sunday at 12am - cron: '0 0 * * 0' @@ -29,19 +32,19 @@ jobs: contents: read security-events: write steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Initialize CodeQL - uses: github/codeql-action/init@v2 - with: - languages: swift - config-file: ./.github/codeql/codeql-config.yml + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: swift + config-file: ./.github/codeql/codeql-config.yml - - name: Build - run: swift build --arch arm64 --build-tests + - name: Build + run: swift build --arch arm64 --build-tests - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v2 - with: - category: "/language:swift" + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 + with: + category: "/language:swift" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 55d3dcc6..e8cbe868 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -1,9 +1,13 @@ -name: Documentation +name: Deploy Documentation on: push: branches: - main + paths: + - ".github/workflows/documentation.yml" + - "**/*.swift" + - "**/*.docc/**/*.md" workflow_dispatch: permissions: @@ -20,12 +24,10 @@ env: SWIFTCI_DOCC: 1 jobs: - deploy: - name: Deploy Documentation - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }}documentation/tmdb - runs-on: macos-13 + build: + name: Build + runs-on: ubuntu-latest + container: swift:5.9.2-jammy steps: - name: Checkout uses: actions/checkout@v4 @@ -46,7 +48,15 @@ jobs: uses: actions/upload-pages-artifact@v3 with: path: 'docs' - + + deploy: + name: Deploy + runs-on: ubuntu-latest + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }}documentation/tmdb + steps: - name: Deploy to GitHub Pages id: deployment uses: actions/deploy-pages@v4 diff --git a/.github/workflows/integration-noop.yml b/.github/workflows/integration-noop.yml new file mode 100644 index 00000000..bfc4021f --- /dev/null +++ b/.github/workflows/integration-noop.yml @@ -0,0 +1,21 @@ +name: Integration + +on: + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/integration.yml" + - "**/*.swift" + +concurrency: + group: "integration-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + integration-test: + name: Integration Test + runs-on: ubuntu-latest + steps: + - name: Test + run: 'echo "No test required"' diff --git a/.github/workflows/integration.yml b/.github/workflows/integration.yml index f01b58fd..0a0fa7be 100644 --- a/.github/workflows/integration.yml +++ b/.github/workflows/integration.yml @@ -4,6 +4,9 @@ on: pull_request: branches: - main + paths: + - ".github/workflows/integration.yml" + - "**/*.swift" schedule: # Every Sunday at 12am - cron: '0 0 * * 0' diff --git a/.github/workflows/lint-markdown-noop.yml b/.github/workflows/lint-markdown-noop.yml new file mode 100644 index 00000000..3a9c2677 --- /dev/null +++ b/.github/workflows/lint-markdown-noop.yml @@ -0,0 +1,29 @@ +name: Lint Markdown + +on: + push: + branches: + - main + paths-ignore: + - ".github/workflows/lint-markdown.yml" + - "README.md" + - "**/*.docc/**/*.md" + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/lint-markdown.yml" + - "README.md" + - "**/*.docc/**/*.md" + +concurrency: + group: "lint-markdown-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + markdownlint: + name: Markdownlint + runs-on: ubuntu-latest + steps: + - name: Lint + run: 'echo "No linting required"' diff --git a/.github/workflows/lint-markdown.yml b/.github/workflows/lint-markdown.yml new file mode 100644 index 00000000..07b4b2ea --- /dev/null +++ b/.github/workflows/lint-markdown.yml @@ -0,0 +1,38 @@ +name: Lint + +on: + push: + branches: + - main + paths: + - ".github/workflows/lint-markdown.yml" + - "README.md" + - "**/*.docc/**/*.md" + pull_request: + branches: + - main + paths: + - ".github/workflows/lint-markdown.yml" + - "README.md" + - "**/*.docc/**/*.md" + workflow_dispatch: + +concurrency: + group: "lint-markdown-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + markdownlint: + name: Markdownlint + runs-on: ubuntu-latest + container: + image: docker://ghcr.io/igorshubovych/markdownlint-cli:latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Lint README + run: markdownlint "README.md" + + - name: Lint DocC files + run: markdownlint "**/*.docc/**/*.md" diff --git a/.github/workflows/lint-noop.yml b/.github/workflows/lint-noop.yml new file mode 100644 index 00000000..d7880cde --- /dev/null +++ b/.github/workflows/lint-noop.yml @@ -0,0 +1,34 @@ +name: Lint + +on: + push: + branches: + - main + paths-ignore: + - ".github/workflows/lint.yml" + - "**/*.swift" + pull_request: + branches: + - main + paths-ignore: + - ".github/workflows/lint.yml" + - "**/*.swift" + +concurrency: + group: "lint-${{ github.head_ref || github.run_id }}" + cancel-in-progress: true + +jobs: + swiftlint: + name: Swiftlint + runs-on: ubuntu-latest + steps: + - name: Swiftlint + run: 'echo "No linting required"' + + swiftformat: + name: SwiftFormat + runs-on: ubuntu-latest + steps: + - name: SwiftFormat + run: 'echo "No linting required"' diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 1b49f706..c9311121 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -4,9 +4,15 @@ on: push: branches: - main + paths: + - ".github/workflows/lint.yml" + - "**/*.swift" pull_request: branches: - main + paths: + - ".github/workflows/lint.yml" + - "**/*.swift" workflow_dispatch: concurrency: @@ -37,31 +43,3 @@ jobs: - name: SwiftFormat run: swiftformat --lint . - - markdownlint: - name: Markdownlint - runs-on: ubuntu-latest - container: - image: docker://ghcr.io/igorshubovych/markdownlint-cli:latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Lint README - run: markdownlint "README.md" - - - name: Lint DocC files - run: markdownlint "**/*.docc/**/*.md" - - # markdownlint: - # name: Markdownlint - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - - # - name: Lint README - # run: docker run --rm -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "README.md" - - # - name: Lint DocC files - # run: docker run --rm -v $PWD:/workdir ghcr.io/igorshubovych/markdownlint-cli:latest "**/*.docc/**/*.md"