Update dependency aquaproj/aqua to v1.38.0 #3393
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: test | |
on: | |
push: | |
branches: [main] | |
pull_request: | |
branches: [main] | |
env: | |
AQUA_LOG_COLOR: always | |
jobs: | |
test: | |
strategy: | |
matrix: | |
env: | |
- runs-on: windows-latest | |
- runs-on: ubuntu-latest | |
- runs-on: macos-latest | |
- runs-on: ubuntu-latest | |
goarch: arm64 | |
- runs-on: ubuntu-latest | |
goos: darwin | |
goarch: arm64 | |
- runs-on: windows-latest | |
goarch: arm64 | |
runs-on: ${{ matrix.env.runs-on }} | |
defaults: | |
run: | |
shell: bash | |
env: | |
AQUA_CONFIG: aqua/test.yaml | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: aquaproj/aqua-installer@v1.1.1-0 | |
with: | |
aqua_version: v1.38.0 | |
- name: Run ci-info and update environment variables | |
# TODO Run the command without `aqua exec`. | |
# We don't know the cause, but `ci-info run | sed -E "s/^export //" >> "$GITHUB_ENV"` doesn't work on Windows. | |
# So we run ci-info via `aqua exec`. | |
run: aqua exec -- ci-info run | sed -E "s/^export //" >> "$GITHUB_ENV" | |
- name: Update aqua/test.yaml | |
run: | | |
if grep -E "target:" "$CI_INFO_TEMP_DIR/labels.txt" > /dev/null 2>&1; then | |
grep -E "target:" "$CI_INFO_TEMP_DIR/labels.txt" | sed "s|^target:\(.*\)| - import: pkgs/\1/pkg.yaml|" >> aqua/test.yaml | |
fi | |
if grep -E "^pkgs/.*\.yaml" < "$CI_INFO_TEMP_DIR/pr_all_filenames.txt" > /dev/null 2>&1; then | |
grep -E "^pkgs/.*\.yaml" < "$CI_INFO_TEMP_DIR/pr_all_filenames.txt" | sed "s/registry\.yaml/pkg.yaml/" | sort -u | sed "s/^/ - import: /" >> aqua/test.yaml | |
fi | |
echo "[INFO] aqua/test.yaml" >&2 | |
cat aqua/test.yaml >&2 | |
- name: Check if go is required | |
id: go_required | |
run: | | |
if grep '\- import:' aqua/test.yaml | sed 's| - import: \(.*\)/pkg.yaml|\1/registry.yaml|' | xargs cat | grep "type: go" > /dev/null 2>&1; then | |
echo "::set-output name=value::true" | |
else | |
echo "::set-output name=value::false" | |
fi | |
- name: Install Go | |
if: steps.go_required.outputs.value == 'true' | |
uses: actions/setup-go@v3 | |
with: | |
go-version: "1.18.4" | |
- name: Install packages for testing | |
run: aqua i --test | |
env: | |
AQUA_LOG_LEVEL: debug | |
AQUA_GOOS: ${{ matrix.env.goos }} | |
AQUA_GOARCH: ${{ matrix.env.goarch }} | |
# This job is used for branch protection rule | |
# Add this job to `Status checks that are required` | |
status-check: | |
runs-on: ubuntu-latest | |
needs: [test] | |
if: failure() | |
steps: | |
- run: exit 1 |