From 4ae9ca22715a56f9ad52898c2bea4ae2f4b6c41b Mon Sep 17 00:00:00 2001 From: Florian Friedrich Date: Wed, 29 Mar 2023 12:38:51 +0200 Subject: [PATCH] Update workflows --- .github/workflows/docs.yml | 20 ++++++------- .github/workflows/enable-auto-merge.yml | 1 + .github/workflows/swift-test.yml | 38 ++++++++++++------------- 3 files changed, 30 insertions(+), 29 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 8ea15eb..8a4c9f9 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -6,16 +6,16 @@ on: - published - edited push: - branches: [ master ] + branches: [ main ] jobs: release-context: runs-on: ubuntu-latest outputs: version-name: ${{ github.ref_name }} - is-latest: ${{ steps.compare-tags.output.is-latest }} + is-latest: ${{ steps.compare-tags.outputs.is-latest }} steps: - - uses: joutvhu/get-release@v1.0.2 + - uses: joutvhu/get-release@v1 id: latest-release with: latest: true @@ -43,7 +43,7 @@ jobs: - uses: swift-actions/setup-swift@v1.22.0 with: swift-version: '5.7' - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3 # We don't use a cache here, because SPM doesn't resolve dependencies when dumping packages. - name: Dump package id: dump-package @@ -67,16 +67,16 @@ jobs: with: swift-version: '5.7' - name: Read OS Version - uses: sersoft-gmbh/os-version-action@v2.0.1 + uses: sersoft-gmbh/os-version-action@v2 id: os-version - - uses: actions/checkout@v3.5.0 - - uses: actions/cache@v3.3.1 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: .build key: ${{ runner.os }}-${{ steps.os-version.outputs.version }}-spm-${{ steps.swift-setup.outputs.version }}-${{ hashFiles('**/Package.resolved') }} restore-keys: | ${{ runner.os }}-${{ steps.os-version.outputs.version }}-spm-${{ steps.swift-setup.outputs.version }}- - - uses: sersoft-gmbh/swifty-docs-action@v2.0.3 + - uses: sersoft-gmbh/swifty-docs-action@v2 env: ENABLE_DOCC_SUPPORT: '1' DOCC_JSON_PRETTYPRINT: 'YES' @@ -104,7 +104,7 @@ jobs: - generate-docs runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3 with: ref: gh-pages path: repository @@ -216,7 +216,7 @@ jobs: else echo 'has-changes=false' >> "${GITHUB_OUTPUT}" fi - - uses: crazy-max/ghaction-github-pages@v3.1.0 + - uses: crazy-max/ghaction-github-pages@v3 if: ${{ steps.check-changes.outputs.has-changes }} with: keep_history: true diff --git a/.github/workflows/enable-auto-merge.yml b/.github/workflows/enable-auto-merge.yml index 11f8b7b..6b3a13a 100644 --- a/.github/workflows/enable-auto-merge.yml +++ b/.github/workflows/enable-auto-merge.yml @@ -4,6 +4,7 @@ on: pull_request permissions: contents: write + pull-requests: write jobs: enable-auto-merge: diff --git a/.github/workflows/swift-test.yml b/.github/workflows/swift-test.yml index 9ee9675..f568c7e 100644 --- a/.github/workflows/swift-test.yml +++ b/.github/workflows/swift-test.yml @@ -2,9 +2,9 @@ name: Tests on: push: - branches: [ master ] + branches: [ main ] pull_request: - branches: [ master ] + branches: [ main ] jobs: test-spm: @@ -25,24 +25,24 @@ jobs: steps: - if: ${{ runner.os == 'macOS' }} - uses: maxim-lobanov/setup-xcode@v1.5.1 + uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ${{ matrix.xcode-version }} - name: Install Swift if: ${{ runner.os == 'Linux' }} - uses: sersoft-gmbh/swifty-linux-action@v2.1.1 + uses: sersoft-gmbh/swifty-linux-action@v2 with: release-version: ${{ matrix.swift-version }} platform: ${{ matrix.os }} github-token: ${{ secrets.GITHUB_TOKEN }} - name: Read OS Version - uses: sersoft-gmbh/os-version-action@v2.0.1 + uses: sersoft-gmbh/os-version-action@v2 id: os-version - name: Read Swift Version - uses: sersoft-gmbh/swift-version-action@v2.0.1 + uses: sersoft-gmbh/swift-version-action@v2 id: swift-version - - uses: actions/checkout@v3.5.0 - - uses: actions/cache@v3.3.1 + - uses: actions/checkout@v3 + - uses: actions/cache@v3 with: path: .build key: ${{ runner.os }}-${{ steps.os-version.outputs.version }}-spm-${{ steps.swift-version.outputs.version }}-${{ hashFiles('**/Package.resolved') }} @@ -51,9 +51,9 @@ jobs: - name: Build & Test run: swift test -v --parallel --enable-code-coverage - name: Generate Coverage Files - uses: sersoft-gmbh/swift-coverage-action@v3.0.1 + uses: sersoft-gmbh/swift-coverage-action@v3 id: coverage-files - - uses: codecov/codecov-action@v3.1.1 + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }} @@ -68,14 +68,14 @@ jobs: env: XCODE_SCHEME: route-docs steps: - - uses: maxim-lobanov/setup-xcode@v1.5.1 + - uses: maxim-lobanov/setup-xcode@v1 with: xcode-version: ^14.1 - name: Read OS Version - uses: sersoft-gmbh/os-version-action@v2.0.1 + uses: sersoft-gmbh/os-version-action@v2 id: os-version - name: Read Swift Version - uses: sersoft-gmbh/swift-version-action@v2.0.1 + uses: sersoft-gmbh/swift-version-action@v2 id: swift-version - name: Select destination id: destination @@ -92,9 +92,9 @@ jobs: *) echo "::error title=Unknown platform!::Unknown platform: ${PLATFORM}" && exit 1;; esac echo "xcode=${DESTINATION}" >> "${GITHUB_OUTPUT}" - - uses: actions/checkout@v3.5.0 + - uses: actions/checkout@v3 # PIF ISSUES: https://github.com/apple/swift-package-manager/issues/5767 - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3 with: path: .build key: ${{ runner.os }}-${{ steps.os-version.outputs.version }}-spm-${{ steps.swift-version.outputs.version }}-${{ hashFiles('**/Package.resolved') }} @@ -111,13 +111,13 @@ jobs: ATTEMPT=$((ATTEMPT + 1)) done # END PIF ISSUES - - uses: actions/cache@v3.3.1 + - uses: actions/cache@v3 with: path: .derived-data key: ${{ runner.os }}-${{ steps.os-version.outputs.version }}-xcode-${{ steps.swift-version.outputs.version }}-${{ matrix.platform }}-${{ hashFiles('**/Package.resolved') }} restore-keys: | ${{ runner.os }}-${{ steps.os-version.outputs.version }}-xcode-${{ steps.swift-version.outputs.version }}-${{ matrix.platform }}- - - uses: sersoft-gmbh/xcodebuild-action@v2.0.1 + - uses: sersoft-gmbh/xcodebuild-action@v2 with: spm-package: './' scheme: ${{ env.XCODE_SCHEME }} @@ -126,14 +126,14 @@ jobs: parallel-testing-enabled: ${{ matrix.platform != 'watchOS' }} enable-code-coverage: true derived-data-path: .derived-data - - uses: sersoft-gmbh/swift-coverage-action@v3.0.1 + - uses: sersoft-gmbh/swift-coverage-action@v3 id: coverage-files with: search-paths: | ./.build ./.derived-data $HOME/Library/Developer/Xcode/DerivedData - - uses: codecov/codecov-action@v3.1.1 + - uses: codecov/codecov-action@v3 with: token: ${{ secrets.CODECOV_TOKEN }} files: ${{ join(fromJSON(steps.coverage-files.outputs.files), ',') }}