Upgrade tools #216
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: | |
- 'README.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@v2 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
uses: deadsnakes/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
uses: actions/[email protected] | |
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@v1 | |
with: | |
token: ${{ github.token }} | |
build: | |
needs: lint | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-12 # amd64 | |
- macos-14 # arm64 | |
- windows-2019 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} (ubuntu-latest) | |
if: matrix.os == 'ubuntu-latest' | |
uses: deadsnakes/[email protected] | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Python ${{ env.PYTHON_DEFAULT_VERSION }} | |
if: matrix.os != 'ubuntu-latest' | |
uses: actions/setup-python@v2 | |
with: | |
python-version: ${{ env.PYTHON_DEFAULT_VERSION }} | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
uses: actions/[email protected] | |
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@v2 | |
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.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
- macos-12 # amd64 | |
- macos-14 # arm64 | |
- windows-2019 | |
terraform: | |
- '1.5.*' | |
- '1.4.*' | |
exclude: | |
- os: macos-12 # for macOS, the latest terraform is enough for ACC tests | |
terraform: '1.4.*' | |
- os: macos-14 # for macOS, the latest terraform is enough for ACC tests | |
terraform: '1.4.*' | |
- os: windows-2019 # for Windows, the latest terraform is enough for ACC tests | |
terraform: '1.4.*' | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go ${{ env.GO_DEFAULT_VERSION }} | |
if: ${{ env.B2_TEST_APPLICATION_KEY != '' && env.B2_TEST_APPLICATION_KEY_ID != '' }} | |
uses: actions/[email protected] | |
with: | |
go-version: ${{ env.GO_DEFAULT_VERSION }} | |
- uses: hashicorp/setup-terraform@v2 | |
name: Set up Terraform ${{ matrix.terraform }} | |
with: | |
terraform_version: ${{ matrix.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@v2 | |
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 |