Skip to content

Commit

Permalink
Update go.yml for GitHub Actions to start using the arm64 hosted runners
Browse files Browse the repository at this point in the history
  • Loading branch information
matsuo committed Jan 18, 2025
1 parent eb3275b commit 35ccf62
Showing 1 changed file with 11 additions and 23 deletions.
34 changes: 11 additions & 23 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
strategy:
matrix:
# https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners
os: [ 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-24.04', 'ubuntu-latest', 'macos-13', 'macos-14', 'macos-15', 'macos-latest', 'windows-2019', 'windows-2022', 'windows-latest' ]
os: [ 'ubuntu-20.04', 'ubuntu-22.04', 'ubuntu-22.04-arm', 'ubuntu-24.04', 'ubuntu-24.04-arm', 'ubuntu-latest', 'macos-13', 'macos-14', 'macos-15', 'macos-latest', 'windows-2019', 'windows-2022', 'windows-latest' ]
steps:

- uses: actions/checkout@v4
Expand All @@ -33,9 +33,6 @@ jobs:
- if: runner.os == 'macOS'
run: make dist && cp -p "dist/fmcsadmin-${{ env.fmcsadmin_version }}-macos/fmcsadmin" .

- if: runner.os == 'Linux' && matrix.os == 'ubuntu-24.04'
run: make build-linux-arm64

- shell: bash
run: echo "goss_commit_hash=5704120d25902119cb1139e04bca3db7742a9f73" >> "$GITHUB_ENV" # v0.4.9

Expand All @@ -51,19 +48,19 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN_202507 }}

- if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
- if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
name: Pull from GitHub Container Registry
run: |
docker pull --platform=linux/amd64 ghcr.io/matsuo/goss:latest
docker run --platform=linux/amd64 --rm -i -v /$(pwd):/tmp ghcr.io/matsuo/goss:latest bash <<'EOF'
docker pull ghcr.io/matsuo/goss:latest
docker run --rm -i -v /$(pwd):/tmp ghcr.io/matsuo/goss:latest bash <<'EOF'
cd /root/go/src/github.com/goss-org/goss
cp ./release/goss-darwin-amd64 /tmp/goss-darwin-amd64
cp ./release/goss-darwin-arm64 /tmp/goss-darwin-arm64
cp ./release/goss-linux-amd64 /tmp/goss-linux-amd64
cp ./release/goss-linux-arm64 /tmp/goss-linux-arm64
EOF
- if: runner.os == 'macOS' || (runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo'))
- if: runner.os == 'macOS' || matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-24.04-arm' || (runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo'))
run: |
curl -L "https://github.com/goss-org/goss/archive/${{ env.goss_commit_hash }}.tar.gz" -o goss.tar.gz
tar xzvf goss.tar.gz
Expand All @@ -82,15 +79,19 @@ jobs:
mv goss-windows-amd64.exe release/
cd ..
- if: runner.os == 'Linux' && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
- if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && (github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
run: |
./goss-linux-amd64 --version
OS=linux ./goss-linux-amd64 --gossfile tests/goss.yaml validate --format documentation
- if: runner.os == 'Linux' && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
- if: (matrix.os == 'ubuntu-22.04' || matrix.os == 'ubuntu-24.04' || matrix.os == 'ubuntu-latest') && !(github.repository_owner == 'emic' || github.repository_owner == 'matsuo')
run: |
OS=linux "./goss-${{ env.goss_commit_hash }}/release/goss-linux-amd64" --gossfile tests/goss.yaml validate --format documentation
- if: matrix.os == 'ubuntu-22.04-arm' || matrix.os == 'ubuntu-24.04-arm'
run: |
OS=linux "./goss-${{ env.goss_commit_hash }}/release/goss-linux-arm64" --gossfile tests/goss.yaml validate --format documentation
- if: runner.os == 'macOS'
run: |
OS=darwin "./goss-${{ env.goss_commit_hash }}/release/goss-darwin-amd64" --gossfile tests/goss.yaml validate --format documentation
Expand All @@ -102,19 +103,6 @@ jobs:
- run: ./fmcsadmin -v

- if: runner.os == 'Linux' && matrix.os == 'ubuntu-24.04'
name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf # v3.2.0

- if: ${{ false }}
run: |
docker run --rm --env GOSS_COMMIT_HASH=${{ env.goss_commit_hash }} -i -v /$(pwd):/tmp arm64v8/ubuntu:24.04 bash <<'EOF'
cd /tmp
cp -p ./dist/linux-arm64/fmcsadmin ./fmcsadmin
OS=linux "./goss-linux-arm64" --gossfile tests/goss.yaml validate --format documentation
./fmcsadmin -v
EOF
- name: Create dmg format file for macOS
if: runner.os == 'macOS'
run: |
Expand Down

0 comments on commit 35ccf62

Please sign in to comment.