Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use Makefile for CI jobs #3046

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
May 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 3 additions & 10 deletions .github/workflows/functional-baremetal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,6 @@ jobs:
steps:
- name: Checkout Gophercloud
uses: actions/checkout@v4
- name: Workaround for grub-efi-amd64-signed
run: sudo rm /var/cache/debconf/config.dat
shell: bash
if: matrix.ubuntu_version == '20.04'
- name: Ensure update and upgrade
run: sudo apt update && sudo apt -y upgrade
shell: bash
if: matrix.ubuntu_version == '20.04'
- name: Work around broken dnsmasq
run: sudo apt-get purge -y dnsmasq-base
- name: Deploy devstack
Expand Down Expand Up @@ -93,10 +85,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-baremetal
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/baremetal/..."
OS_BRANCH: ${{ matrix.openstack_version }}
# TODO(dtantsur): default to true when no longer supporting versions before 2024.1
USE_SYSTEM_SCOPE: ${{ matrix.use_system_scope }}
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-basic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-basic
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: './internal/acceptance/openstack'
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-blockstorage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-blockstorage
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/blockstorage/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-compute.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-compute
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/compute/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-containerinfra.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-containerinfra
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/containerinfra/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-dns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-dns
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/dns/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-fwaas_v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-networking
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/networking/v2/extensions/fwaas_v2/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-identity.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-identity
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/identity/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-image
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/image/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-keymanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-keymanager
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/keymanager/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-loadbalancer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-loadbalancer
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/loadbalancer/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-messaging.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-messaging
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/messaging/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-networking.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-networking
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/networking/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-objectstorage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-objectstorage
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/objectstorage/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-orchestration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-orchestration
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/orchestration/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-placement.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-placement
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/placement/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-sharedfilesystems.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-sharedfilesystems
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/sharedfilesystems/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/functional-workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,11 @@ jobs:
with:
go-version: '^1.23'
- name: Run Gophercloud acceptance tests
run: ./script/acceptancetest
run: |
source ${{ github.workspace }}/script/stackenv
make acceptance-workflow
env:
DEVSTACK_PATH: ${{ github.workspace }}/devstack
PACKAGE: "./internal/acceptance/openstack/workflow/..."
OS_BRANCH: ${{ matrix.openstack_version }}
- name: Generate logs on failure
run: ./script/collectlogs
Expand Down
22 changes: 9 additions & 13 deletions .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
@@ -1,27 +1,23 @@
on: [push, pull_request]
name: Linters
on:
- push
- pull_request
permissions:
contents: read

jobs:
test:
runs-on: ubuntu-latest

steps:
- name: Checkout Gophercloud
uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: '1'

- uses: actions/checkout@v4

- name: Run go fmt
- name: Run linters
run: |
./script/format

- name: Run go vet
run: |
./script/vet

make lint
# TODO: Use 'go mod tidy -diff' instead once go 1.23 is out
# https://github.com/golang/go/issues/27005
- name: Ensure go.mod is up-to-date
run: |
if [ $(go mod tidy && git diff | wc -l) -gt 0 ]; then git diff && exit 1; fi
19 changes: 7 additions & 12 deletions .github/workflows/unit.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
on: [push, pull_request]
name: Unit Testing
on:
- push
- pull_request
permissions:
contents: read

jobs:
test:
permissions:
Expand All @@ -15,35 +16,29 @@ jobs:
go-version:
- "1.23.0"
- "1"

steps:
- name: Checkout Gophercloud
uses: actions/checkout@v4
- name: Setup Go ${{ matrix.go-version }}
uses: actions/setup-go@v5
with:
go-version: ${{ matrix.go-version }}

- uses: actions/checkout@v4

- name: Setup environment
run: |
# Changing into a different directory to avoid polluting go.sum with "go get"
cd "$(mktemp -d)"
go mod init unit_tests

go install github.com/wadey/gocovmerge@master

- name: Run unit tests
run: |
./script/coverage
./script/unittest

make unit
make coverage
- name: Check coverage
uses: coverallsapp/github-action@v2
with:
file: cover.out
flag-name: Go-${{ matrix.go-version }}
parallel: true

finish:
permissions:
checks: write # for coverallsapp/github-action to create a new check based on the results
Expand Down
Loading
Loading