diff --git a/.github/test-suite/build_gosop.sh b/.github/test-suite/build_gosop.sh index 6ff16980..b7b24caf 100755 --- a/.github/test-suite/build_gosop.sh +++ b/.github/test-suite/build_gosop.sh @@ -1,4 +1,5 @@ +VERSION=$(awk '/^module github.com\/ProtonMail\/gopenpgp\/v[0-9]+/ {print $NF}' gopenpgp/go.mod | awk -F'v' '{print $2}') + cd gosop -echo "replace github.com/ProtonMail/gopenpgp/v3 => ../gopenpgp" >> go.mod -go get github.com/ProtonMail/gopenpgp/v3/crypto +echo "replace github.com/ProtonMail/gopenpgp/v${VERSION} => ../gopenpgp" >> go.mod go build . diff --git a/.github/test-suite/config.json.template b/.github/test-suite/config.json.template index ac3701f3..4d67575a 100644 --- a/.github/test-suite/config.json.template +++ b/.github/test-suite/config.json.template @@ -5,8 +5,8 @@ "path": "__GOSOP_BRANCH__" }, { - "id": "gosop-main", - "path": "__GOSOP_MAIN__" + "id": "gosop-target", + "path": "__GOSOP_TARGET__" }, { "path": "__SQOP__" diff --git a/.github/test-suite/determine_gosop_branch.sh b/.github/test-suite/determine_gosop_branch.sh index de071150..d3525783 100755 --- a/.github/test-suite/determine_gosop_branch.sh +++ b/.github/test-suite/determine_gosop_branch.sh @@ -4,4 +4,4 @@ if [ "$VERSION" -eq 3 ]; then echo "gosop-gopenpgp-v3" else echo "main" -fi \ No newline at end of file +fi diff --git a/.github/test-suite/prepare_config.sh b/.github/test-suite/prepare_config.sh index 0e6534d9..e18d8031 100755 --- a/.github/test-suite/prepare_config.sh +++ b/.github/test-suite/prepare_config.sh @@ -1,10 +1,10 @@ CONFIG_TEMPLATE=$1 CONFIG_OUTPUT=$2 GOSOP_BRANCH=$3 -GOSOP_MAIN=$4 +GOSOP_TARGET=$4 cat $CONFIG_TEMPLATE \ | sed "s@__GOSOP_BRANCH__@${GOSOP_BRANCH}@g" \ - | sed "s@__GOSOP_MAIN__@${GOSOP_MAIN}@g" \ + | sed "s@__GOSOP_TARGET__@${GOSOP_TARGET}@g" \ | sed "s@__SQOP__@${SQOP}@g" \ | sed "s@__GPGME_SOP__@${GPGME_SOP}@g" \ | sed "s@__SOP_OPENPGPJS__@${SOP_OPENPGPJS_V2}@g" \ diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 925e9a3c..f0cb4484 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] + branches: [ main, v3 ] jobs: build: diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index 066c522c..af48ce75 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] + branches: [ main, v3 ] jobs: test: diff --git a/.github/workflows/ios.yml b/.github/workflows/ios.yml index 7f229c99..9385f4df 100644 --- a/.github/workflows/ios.yml +++ b/.github/workflows/ios.yml @@ -4,7 +4,7 @@ on: push: branches: [ main ] pull_request: - branches: [ main ] + branches: [ main, v3 ] jobs: build: diff --git a/.github/workflows/sop-test-suite.yml b/.github/workflows/sop-test-suite.yml index 521d3cd0..6ed7aede 100644 --- a/.github/workflows/sop-test-suite.yml +++ b/.github/workflows/sop-test-suite.yml @@ -2,7 +2,7 @@ name: SOP interoperability test suite on: pull_request: - branches: [ main ] + branches: [ main, v3 ] jobs: @@ -23,8 +23,8 @@ jobs: name: gosop-${{ github.sha }} path: ./gosop-${{ github.sha }} - build-gosop-main: - name: Build gosop from main + build-gosop-target: + name: Build gosop from target runs-on: ubuntu-latest steps: - name: Checkout @@ -32,14 +32,14 @@ jobs: - name: Build gosop from branch uses: ./.github/actions/build-gosop with: - gopenpgp-ref: main - binary-location: ./gosop-main + gopenpgp-ref: ${{ github.base_ref }} + binary-location: ./gosop-target # Upload as artifact - - name: Upload gosop-main artifact + - name: Upload gosop-target artifact uses: actions/upload-artifact@v3 with: - name: gosop-main - path: ./gosop-main + name: gosop-target + path: ./gosop-target test-suite: @@ -52,20 +52,20 @@ jobs: password: ${{ secrets.github_token }} needs: - build-gosop - - build-gosop-main + - build-gosop-target steps: - name: Checkout uses: actions/checkout@v3 - # Fetch gosop from main - - name: Download gosop-main + # Fetch gosop from target + - name: Download gosop-target uses: actions/download-artifact@v3 with: - name: gosop-main - # Test gosop-main - - name: Make gosop-main executable - run: chmod +x gosop-main - - name: Print gosop-main version - run: ./gosop-main version --extended + name: gosop-target + # Test gosop-target + - name: Make gosop-target executable + run: chmod +x gosop-target + - name: Print gosop-target version + run: ./gosop-target version --extended # Fetch gosop from branch - name: Download gosop-branch uses: actions/download-artifact@v3 @@ -80,7 +80,7 @@ jobs: run: ./gosop-branch version --extended # Run test suite - name: Prepare test configuration - run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch $GITHUB_WORKSPACE/gosop-main + run: ./.github/test-suite/prepare_config.sh $CONFIG_TEMPLATE $CONFIG_OUTPUT $GITHUB_WORKSPACE/gosop-branch $GITHUB_WORKSPACE/gosop-target env: CONFIG_TEMPLATE: .github/test-suite/config.json.template CONFIG_OUTPUT: .github/test-suite/config.json @@ -104,8 +104,8 @@ jobs: name: test-suite-results.html path: .github/test-suite/test-suite-results.html - compare-with-main: - name: Compare with main + compare-with-target: + name: Compare with target runs-on: ubuntu-latest needs: test-suite steps: @@ -121,5 +121,5 @@ jobs: with: results: ${{ steps.download-test-results.outputs.download-path }}/test-suite-results.json output: baseline-comparison.json - baseline: gosop-main + baseline: gosop-target target: gosop-branch