Skip to content

Update module golang.org/x/oauth2 to v0.36.0 #365

Update module golang.org/x/oauth2 to v0.36.0

Update module golang.org/x/oauth2 to v0.36.0 #365

Workflow file for this run

name: Test spread-plus
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Build Spread
runs-on: ubuntu-latest
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install dependencies
env:
GOCHANNEL: 1.24/stable
run: |
sudo snap install go --classic --channel "$GOCHANNEL"
- name: Build spread
run: |
GOARCH="${{ matrix.arch }}" go build -o spread-plus cmd/spread/main.go
- name: Upload spread binary to cache
uses: actions/upload-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-${{ matrix.arch }}"
path: "spread-plus"
integration-tests:
name: Integration Tests
needs: [build]
runs-on: [self-hosted, spread-enabled]
environment: OS_AMD64_PS7
steps:
- name: Ensure the workspace is clean
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-amd64"
path: "${{ github.workspace }}/bin"
- name: Integration tests
env:
OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
OS_IDENTITY_API_VERSION: ${{ vars.OS_IDENTITY_API_VERSION }}
OS_INTERFACE: ${{ vars.OS_INTERFACE }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_DOMAIN_NAME: ${{ vars.OS_PROJECT_DOMAIN_NAME }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
OS_USER_DOMAIN_NAME: ${{ vars.OS_USER_DOMAIN_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
run: |
chmod +x "${{ github.workspace }}"/bin/spread-plus
# "pipefail" ensures that a non-zero status from the spread is propagated
(
set -o pipefail
"${{ github.workspace }}/bin/spread-plus" openstack:tests/ | tee spread.log
)
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob;
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')";
done
smoke-tests-google:
name: Smoke Tests in Google
needs: [build]
runs-on: [self-hosted, spread-enabled]
steps:
- name: Ensure the workspace is clean
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-amd64"
path: "${{ github.workspace }}/bin"
- name: Smoke tests with google backend
env:
SPREAD_GOOGLE_KEY: ${{ secrets.SPREAD_GOOGLE_KEY }}
SPREAD_PARAMS: ${{ vars.SPREAD_PARAMS }}
run: |
cd "${{ github.workspace }}"/smoke
chmod +x "${{ github.workspace }}"/bin/spread-plus
# "pipefail" ensures that a non-zero status from the spread is propagated
(
set -o pipefail
"${{ github.workspace }}/bin/spread-plus" "$SPREAD_PARAMS" google:tests/ | tee spread.log
)
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob;
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')";
done
smoke-tests-openstack-amd64:
name: Smoke Tests in Openstack PS7 (amd64)
needs: [build]
runs-on: [self-hosted, spread-enabled]
environment: OS_AMD64_PS7
steps:
- name: Ensure the workspace is clean
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-amd64"
path: "${{ github.workspace }}/bin"
- name: Smoke tests with openstack backend
env:
OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
OS_IDENTITY_API_VERSION: ${{ vars.OS_IDENTITY_API_VERSION }}
OS_INTERFACE: ${{ vars.OS_INTERFACE }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_DOMAIN_NAME: ${{ vars.OS_PROJECT_DOMAIN_NAME }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
OS_USER_DOMAIN_NAME: ${{ vars.OS_USER_DOMAIN_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_SKIP: ${{ vars.SKIP_OPENSTACK_AMD64_PS7 }}
SPREAD_PARAMS: ${{ vars.SPREAD_PARAMS }}
run: |
if [ "$OS_SKIP" == true ]; then
echo "Skipping openstack smoke tests..."
exit
fi
cd "${{ github.workspace }}"/smoke
chmod +x "${{ github.workspace }}"/bin/spread-plus
# "pipefail" ensures that a non-zero status from the spread is propagated
(
set -o pipefail
"${{ github.workspace }}/bin/spread-plus" "$SPREAD_PARAMS" openstack:tests/ | tee spread.log
)
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob;
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')";
done
smoke-tests-openstack-arm64:
name: Smoke Tests in Openstack PS7 (arm64)
needs: [build]
runs-on: [self-hosted, spread-enabled]
environment: OS_ARM64_PS7
steps:
- name: Ensure the workspace is clean
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-amd64"
path: "${{ github.workspace }}/bin"
- name: Smoke tests with openstack backend
env:
OS_AUTH_URL: ${{ secrets.OS_AUTH_URL }}
OS_IDENTITY_API_VERSION: ${{ vars.OS_IDENTITY_API_VERSION }}
OS_INTERFACE: ${{ vars.OS_INTERFACE }}
OS_PASSWORD: ${{ secrets.OS_PASSWORD }}
OS_PROJECT_DOMAIN_NAME: ${{ vars.OS_PROJECT_DOMAIN_NAME }}
OS_PROJECT_NAME: ${{ secrets.OS_PROJECT_NAME }}
OS_REGION_NAME: ${{ secrets.OS_REGION_NAME }}
OS_USER_DOMAIN_NAME: ${{ vars.OS_USER_DOMAIN_NAME }}
OS_USERNAME: ${{ secrets.OS_USERNAME }}
OS_SKIP: ${{ vars.SKIP_OPENSTACK_ARM64_PS7 }}
SPREAD_PARAMS: ${{ vars.SPREAD_PARAMS }}
run: |
if [ "$OS_SKIP" == true ]; then
echo "Skipping openstack smoke tests..."
exit
fi
cd "${{ github.workspace }}"/smoke
chmod +x "${{ github.workspace }}"/bin/spread-plus
# "pipefail" ensures that a non-zero status from the spread is propagated
(
set -o pipefail
"${{ github.workspace }}/bin/spread-plus" "$SPREAD_PARAMS" openstack-arm:tests/ | tee spread.log
)
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob;
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')";
done
smoke-tests-testflinger:
name: Smoke Tests in Testflinger
needs: [build]
runs-on: [self-hosted, spread-enabled]
if: ${{ vars.SKIP_TESTFLINGER == 'false' }}
steps:
- name: Ensure the workspace is clean
run: |
rm -rf "${{ github.workspace }}"
mkdir "${{ github.workspace }}"
- name: Checkout code
uses: actions/checkout@v4
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-amd64"
path: "${{ github.workspace }}/bin"
- name: Smoke tests with testflinger backend
env:
SPREAD_PARAMS: ${{ vars.SPREAD_PARAMS }}
run: |
cd "${{ github.workspace }}"/smoke
chmod +x "${{ github.workspace }}"/bin/spread-plus
# "pipefail" ensures that a non-zero status from the spread is propagated
(
set -o pipefail
"${{ github.workspace }}/bin/spread-plus" "$SPREAD_PARAMS" testflinger:tests/ | tee spread.log
)
- name: Discard spread workers
if: always()
run: |
shopt -s nullglob;
for r in .spread-reuse.*.yaml; do
spread -discard -reuse-pid="$(echo "$r" | grep -o -E '[0-9]+')";
done
upload:
name: Upload binary to GCE
runs-on: ubuntu-latest
needs: [integration-tests, smoke-tests-google, smoke-tests-openstack-amd64, smoke-tests-openstack-arm64]
strategy:
matrix:
arch: [amd64, arm64]
steps:
- name: Download spread-plus
uses: actions/download-artifact@v4
with:
name: "spread-plus-${{ github.run_id }}-${{ matrix.arch }}"
path: "${{ github.workspace }}/bin"
- name: Upload to google bucket
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
env:
GCLOUD_SA_KEY: ${{ secrets.GCLOUD_SA_KEY }}
SPREAD_FILE: spread-plus-${{ matrix.arch }}
run: |
sudo snap install google-cloud-sdk --classic
echo "$GCLOUD_SA_KEY" > sa.json
gcloud auth activate-service-account --key-file=sa.json
rm -f sa.json
mv "${{ github.workspace }}"/bin/spread-plus spread
chmod +x spread
tar -czf "$SPREAD_FILE".tar.gz spread
# Back up previous spread if it is published
if gsutil ls gs://snapd-spread-tests/spread/"$SPREAD_FILE".tar.gz; then
gsutil cp gs://snapd-spread-tests/spread/"$SPREAD_FILE".tar.gz gs://snapd-spread-tests/spread/"$SPREAD_FILE"-old.tar.gz
fi
gsutil cp "$SPREAD_FILE".tar.gz gs://snapd-spread-tests/spread/"$SPREAD_FILE".tar.gz
- name: Logout from Google Cloud
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
run: |
gcloud auth revoke