Upgrade tools #220
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Continuous Integration | |
on: | |
push: | |
branches: [master] | |
paths-ignore: | |
- '.github/no-response.yml' | |
- '.github/workflows/cd.yml' | |
- 'LICENSE' | |
- 'README.md' | |
- 'README.release.md' | |
pull_request: | |
branches: [master] | |
defaults: | |
run: | |
shell: bash | |
env: | |
PYTHON_DEFAULT_VERSION: '3.12' | |
GO_DEFAULT_VERSION: '1.22' | |
jobs: | |
lint: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: deadsnakes/[email protected] # staticx doesn't work with python installed by setup-python action | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_DEFAULT_VERSION }} | |
- name: Install dependencies | |
run: | | |
make deps | |
- name: Run dependency checker | |
run: | | |
make deps-check | |
- name: Run linters | |
run: | | |
make lint | |
- name: Run docs linters | |
run: | | |
make docs-lint | |
- name: Validate changelog | |
# Library was designed to be used with pull requests only. | |
if: ${{ github.event_name == 'pull_request' && github.actor != 'dependabot[bot]' }} | |
uses: zattoo/changelog@v2 | |
with: | |
token: ${{ github.token }} | |
build: | |
needs: lint | |
runs-on: ${{ matrix.conf.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
conf: | |
- { runner: ubuntu-latest, os: linux, arch: amd64 } | |
- { runner: macos-12, os: darwin, arch: amd64 } | |
- { runner: macos-14, os: darwin, arch: arm64 } | |
- { runner: windows-2019, os: windows, arch: amd64 } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (ubuntu-latest) | |
if: matrix.conf.os == 'linux' | |
uses: deadsnakes/[email protected] # staticx doesn't work with python installed by setup-python action | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
if: matrix.conf.os != 'linux' | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_DEFAULT_VERSION }} | |
- name: Install dependencies | |
run: | | |
make deps | |
- name: Build the provider | |
run: | | |
make build | |
- name: Upload python bindings | |
uses: actions/upload-artifact@v4 | |
with: | |
name: py-terraform-provider-b2-${{ runner.os }}-${{ runner.arch }} | |
path: python-bindings/dist/py-terraform-provider-b2 | |
if-no-files-found: error | |
retention-days: 1 | |
test: | |
needs: build | |
env: | |
B2_TEST_APPLICATION_KEY: ${{ secrets.B2_TEST_APPLICATION_KEY }} | |
B2_TEST_APPLICATION_KEY_ID: ${{ secrets.B2_TEST_APPLICATION_KEY_ID }} | |
NOPYBINDINGS: 1 # do not build python buildings | |
runs-on: ${{ matrix.conf.runner }} | |
strategy: | |
fail-fast: false | |
matrix: | |
conf: | |
- { runner: ubuntu-latest, os: linux, arch: amd64, terraform: '1.9.*' } | |
- { runner: ubuntu-latest, os: linux, arch: amd64, terraform: '1.8.*' } | |
# for macOS, the latest terraform is enough for ACC tests | |
- { runner: macos-12, os: darwin, arch: amd64, terraform: '1.9.*' } | |
- { runner: macos-14, os: darwin, arch: arm64, terraform: '1.9.*' } | |
# for Windows, the latest terraform is enough for ACC tests | |
- { runner: windows-2019, os: windows, arch: amd64, terraform: '1.9.*' } | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ${{ env.GO_DEFAULT_VERSION }} | |
- uses: hashicorp/setup-terraform@v3 | |
name: Set up Terraform ${{ matrix.conf.terraform }} | |
with: | |
terraform_version: ${{ matrix.conf.terraform }} | |
terraform_wrapper: false | |
- name: Download python bindings for given OS | |
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} | |
uses: actions/download-artifact@v4 | |
with: | |
name: py-terraform-provider-b2-${{ runner.os }}-${{ runner.arch }} | |
path: python-bindings/dist/ | |
- name: Run acceptance tests | |
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} | |
timeout-minutes: 120 | |
run: | | |
make testacc |