Skip to content
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

tests: Run with all QGIS 3 LTR images #114

Merged
merged 3 commits into from
May 21, 2021
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
11 changes: 10 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ jobs:
test:
name: test
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
qgis:
- latest
- release-3_16
- release-3_10
- release-3_4
env:
LDI_LINZ_KEY: ${{ secrets.LDI_LINZ_KEY }}
LDI_MFE_KEY: ${{ secrets.LDI_MFE_KEY }}
Expand All @@ -23,7 +31,8 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Run test script
run: ./test.bash "$LDI_LINZ_KEY" "$LDI_MFE_KEY" "$LDI_NZDF_KEY" "$LDI_BASEMAPS_KEY"
run: |
./test.bash "${{ matrix.qgis }}" "$LDI_LINZ_KEY" "$LDI_MFE_KEY" "$LDI_NZDF_KEY" "$LDI_BASEMAPS_KEY"


deploy:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ Please see the [LINZ-Data-Importer](https://github.com/linz/linz-data-importer/)
are executed via [GitHub Actions](https://github.com/linz/linz-data-importer/actions)
for branches listed in the [`ci.yml`](https://github.com/linz/linz-data-importer/blob/master_qgis3/.github/workflows/ci.yml)
file. These tests are against an instance of QGIS within a Docker container as made possible by the
[elpaso's Docker container](https://hub.docker.com/r/elpaso/qgis-testing-environment).
[official Docker container](https://hub.docker.com/r/qgis/qgis).

You can run the tests using the test.bash script: `./test.bash LDI_LINZ_KEY LDI_MFE_KEY LDI_NZDF_KEY LDI_BASEMAPS_KEY`. You can request the keys in these places:
You can run the tests using the test.bash script: `./test.bash QGIS_VERSION LDI_LINZ_KEY LDI_MFE_KEY LDI_NZDF_KEY LDI_BASEMAPS_KEY`. The QGIS version is one of the [official Docker image tags](https://hub.docker.com/r/qgis/qgis/tags). You can request the keys in these places:

- [LDI_LINZ_KEY](https://data.linz.govt.nz/my/api/)
- [LDI_MFE_KEY](https://data.mfe.govt.nz/my/api/)
Expand Down
17 changes: 10 additions & 7 deletions test.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ set -o errexit -o nounset

usage() {
cat >&2 << 'EOF'
./test.bash "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key"
Synopsis: ./test.bash "$qgis_version" "$ldi_linz_key" "$ldi_mfe_key" "$ldi_nzdf_key" "$ldi_basemaps_key"
Example: ./test.bash latest a1 b2 c3 d4

The QGIS version has to be one of the official QGIS Docker image tags <https://hub.docker.com/r/qgis/qgis/tags>.
EOF
}

Expand All @@ -30,19 +33,19 @@ do
esac
done

if [[ $# -ne 4 ]]
if [[ $# -ne 5 ]]
then
usage
exit 2
fi

export LDI_LINZ_KEY="$1"
export LDI_MFE_KEY="$2"
export LDI_NZDF_KEY="$3"
export LDI_BASEMAPS_KEY="$4"
qgis_version_tag="$1"
export LDI_LINZ_KEY="$2"
export LDI_MFE_KEY="$3"
export LDI_NZDF_KEY="$4"
export LDI_BASEMAPS_KEY="$5"

image='qgis/qgis'
qgis_version_tag='latest'
plugin_name='linz-data-importer'
image_name="${image}:${qgis_version_tag}"
container_name="${image/\//-}-${qgis_version_tag}"
Expand Down