fix: curl on ubuntu-20.04 does not support --retry-all-errors #56
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
on: | |
push: | |
branches: | |
- 'main' | |
pull_request: | |
jobs: | |
# This job can be executed locally with the command `act -W .github/workflows/dfx-action.yml` | |
test_dfx_action: | |
runs-on: ${{ matrix.os }} | |
name: Test the dfx action (action.yml) | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- version: '0.11.1' | |
expected-version: '0.11.1' | |
os: ubuntu-20.04 | |
- version: '0.11.1' | |
expected-version: '0.11.1' | |
os: ubuntu-22.04 | |
- version: '0.11.1' | |
expected-version: '0.11.1' | |
os: ubuntu-latest | |
- version: '0.14.1' | |
expected-version: '0.14.1' | |
os: ubuntu-latest | |
- version: '0.14.2-beta.2' | |
expected-version: '0.14.2-beta.2' | |
os: ubuntu-latest | |
- version: 'latest' | |
os: ubuntu-latest | |
- version: 'auto' | |
os: ubuntu-latest | |
- version: 'auto' | |
dfx-json-dfx-version: '0.11.1' | |
expected-version: '0.11.1' | |
os: ubuntu-latest | |
- version: 'auto' | |
dfx-json-dfx-version: '0.14.1' | |
expected-version: '0.14.1' | |
os: ubuntu-latest | |
- version: 'auto' | |
dfx-json-no-dfx-version: 'true' | |
os: ubuntu-latest | |
- version: '0.11.1' | |
expected-version: '0.11.1' | |
os: macos-latest | |
- version: '0.14.1' | |
expected-version: '0.14.1' | |
os: macos-latest | |
- version: '0.14.2-beta.2' | |
expected-version: '0.14.2-beta.2' | |
os: macos-latest | |
- version: 'latest' | |
os: macos-latest | |
- version: 'auto' | |
os: macos-latest | |
- version: 'auto' | |
dfx-json-dfx-version: '0.11.1' | |
expected-version: '0.11.1' | |
os: macos-latest | |
- version: 'auto' | |
dfx-json-dfx-version: '0.14.1' | |
expected-version: '0.14.1' | |
os: macos-latest | |
- version: 'auto' | |
dfx-json-no-dfx-version: 'true' | |
os: macos-latest | |
steps: | |
# To use this repository's private action, you must check out the repository | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup | |
run: | | |
if [ -n "${{ matrix.dfx-json-dfx-version }}" ]; then | |
echo "{\"dfx\": \"${{ matrix.dfx-json-dfx-version }}\"}" > dfx.json | |
elif [ -n "${{ matrix.dfx-json-no-dfx-version }}" ]; then | |
echo "{}" > dfx.json | |
fi | |
# Install a certain `dfx` version and check if it is properly installed | |
- name: Install dfx | |
uses: ./ | |
with: | |
dfx-version: ${{ matrix.version }} | |
- name: Check if the proper dfx version is installed | |
run: | | |
actual_dfx_ver="$(dfx --version)" | |
if [ -n "${{ matrix.expected-version }}" ]; then | |
expected_dfx_ver="dfx ${{ matrix.expected-version }}" | |
if [ "$actual_dfx_ver" != "$expected_dfx_ver" ]; then | |
echo "Error: expected dfx version '$expected_dfx_ver', but '$actual_dfx_ver' found" | |
exit 1 | |
fi | |
echo "dfx version '$actual_dfx_ver' was installed correctly" | |
else | |
echo "dfx version '$actual_dfx_ver' was installed" | |
fi |