From bc463936de7f506d090d749aceea9370c130557b Mon Sep 17 00:00:00 2001 From: YOCKOW Date: Mon, 21 Sep 2020 11:45:34 +0900 Subject: [PATCH] Confirm compatibility with Swift 5.3 --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++----------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d7ed806..53e9b44 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,11 +3,15 @@ on: push: branches: - '**' - tags: - - '!**' - pull_request: - branches: + tags-ignore: - '**' + paths: + - '**/*.swift' + - '.github/workflows/*.yml' + pull_request: + paths: + - '**/*.swift' + - '.github/workflows/*.yml' jobs: test: strategy: @@ -26,32 +30,34 @@ jobs: uses: actions/cache@v1 with: path: .build - key: build-${{ github.workspace }}-${{ runner.os }}-${{ matrix.swift-compat-ver }}-${{ hashFiles('Package.*') }}-${{ hashFiles('Sources/**/*.swift') }} + key: build-${{ github.workspace }}-${{ runner.os }}-${{ matrix.swift-compat-ver }}-${{ hashFiles('**/*.swift') }} restore-keys: | - build-${{ github.workspace }}-${{ runner.os }}-${{ matrix.swift-compat-ver }}-${{ hashFiles('Package.*') }}- build-${{ github.workspace }}-${{ runner.os }}-${{ matrix.swift-compat-ver }}- build-${{ github.workspace }}-${{ runner.os }}- build-${{ github.workspace }}- - uses: YOCKOW/Action-setup-swift@master with: - swift-version: '5.2' + swift-version: '5.3' + - name: Try to build products with debug mode. - run: | - swift build --configuration debug -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} - if [ $? != 0 ]; then - echo "Failed to build products with debug mode." - rm -rf $(cd .build/debug && pwd -P) - fi + run: swift build --configuration debug -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} continue-on-error: true + - name: Clean debug build directory if necessary + if: failure() + run: rm -rf $(cd .build/debug && pwd -P) + - name: Check XCTestManifests.swift + if: runner.os == 'macOS' + run: | + swift test --generate-linuxmain -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} + git diff --exit-code - name: Test with debug mode. run: swift test --configuration debug -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} + - name: Try to build products with release mode. - run: | - swift build --configuration release -Xswiftc -enable-testing -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} - if [ $? != 0 ]; then - echo "Failed to build products with release mode." - rm -rf $(cd .build/release && pwd -P) - fi + run: swift build --configuration release -Xswiftc -enable-testing -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }} continue-on-error: true + - name: Clean release build directory if necessary + if: failure() + run: rm -rf $(cd .build/release && pwd -P) - name: Test with release mode. run: swift test --configuration release -Xswiftc -enable-testing -Xswiftc -swift-version -Xswiftc ${{ matrix.swift-compat-ver }}