Indent GitHub Actions code

This commit is contained in:
Frank Denis 2021-11-10 15:59:50 +01:00
parent 100ccb452d
commit 5ef23a4b35
2 changed files with 241 additions and 244 deletions

View File

@ -4,28 +4,27 @@ on:
push: push:
pull_request: pull_request:
schedule: schedule:
- cron: '0 17 * * 2' - cron: "0 17 * * 2"
jobs: jobs:
CodeQL-Build: CodeQL-Build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with: with:
fetch-depth: 2 fetch-depth: 2
- name: Initialize CodeQL - name: Initialize CodeQL
uses: github/codeql-action/init@v1 uses: github/codeql-action/init@v1
with: with:
languages: cpp languages: cpp
- run: | - run: |
./autogen.sh -s ./autogen.sh -s
env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking env CPPFLAGS="-DDEV_MODE=1" ./configure --disable-dependency-tracking
make -j $(nproc) check make -j $(nproc) check
- name: Perform CodeQL Analysis - name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1 uses: github/codeql-action/analyze@v1

View File

@ -3,189 +3,188 @@ name: .NET Package
on: on:
push: push:
branches: branches:
- stable - stable
- next - next
jobs: jobs:
build-windows: build-windows:
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: buildbase.bat - name: buildbase.bat
run: buildbase.bat ..\vs2019\libsodium.sln 16 run: buildbase.bat ..\vs2019\libsodium.sln 16
working-directory: builds/msvc/build/ working-directory: builds/msvc/build/
shell: cmd shell: cmd
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-win-x64 name: build-win-x64
path: bin/x64/Release/v142/dynamic/libsodium.dll path: bin/x64/Release/v142/dynamic/libsodium.dll
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-win-x86 name: build-win-x86
path: bin/Win32/Release/v142/dynamic/libsodium.dll path: bin/Win32/Release/v142/dynamic/libsodium.dll
build-linux-glibc: build-linux-glibc:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: ubuntu:20.04 image: ubuntu:20.04
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
apt-get update && apt-get install -y build-essential apt-get update && apt-get install -y build-essential
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-debug --prefix=$PWD/.libsodium-build run: ./configure --disable-debug --prefix=$PWD/.libsodium-build
- name: make - name: make
run: make run: make
- name: make check - name: make check
run: make check run: make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: strip --strip-all .libsodium-build/lib/libsodium.so run: strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-linux-x64 name: build-linux-x64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
build-linux-glibc-arm64: build-linux-glibc-arm64:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
cat <<-EOF | sudo tee /etc/apt/sources.list.d/arm64.list >/dev/null cat <<-EOF | sudo tee /etc/apt/sources.list.d/arm64.list >/dev/null
deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted deb [arch=arm64] http://ports.ubuntu.com/ focal main restricted
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted deb [arch=arm64] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=arm64] http://ports.ubuntu.com/ focal universe deb [arch=arm64] http://ports.ubuntu.com/ focal universe
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe deb [arch=arm64] http://ports.ubuntu.com/ focal-updates universe
deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse deb [arch=arm64] http://ports.ubuntu.com/ focal multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse deb [arch=arm64] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse deb [arch=arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF EOF
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
sudo dpkg --add-architecture arm64 sudo dpkg --add-architecture arm64
sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64 sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-aarch64-linux-gnu g++-aarch64-linux-gnu libstdc++6:arm64
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=aarch64-linux-gnu
- name: make - name: make
run: make -j $(nproc) run: make -j $(nproc)
- name: make check - name: make check
run: | run: |
make check make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so run: aarch64-linux-gnu-strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-linux-arm64 name: build-linux-arm64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
build-linux-glibc-arm: build-linux-glibc-arm:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null cat <<-EOF | sudo tee /etc/apt/sources.list.d/armhf.list >/dev/null
deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted deb [arch=armhf] http://ports.ubuntu.com/ focal main restricted
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted deb [arch=armhf] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=armhf] http://ports.ubuntu.com/ focal universe deb [arch=armhf] http://ports.ubuntu.com/ focal universe
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe deb [arch=armhf] http://ports.ubuntu.com/ focal-updates universe
deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse deb [arch=armhf] http://ports.ubuntu.com/ focal multiverse
deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse deb [arch=armhf] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse deb [arch=armhf] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF EOF
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
sudo dpkg --add-architecture armhf sudo dpkg --add-architecture armhf
sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf sudo apt-get update && sudo apt-get install -y build-essential qemu-user qemu-user-static gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf libstdc++6:armhf
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf run: ./configure --disable-debug --prefix=$PWD/.libsodium-build --host=arm-linux-gnueabihf
- name: make - name: make
run: make -j $(nproc) run: make -j $(nproc)
- name: make check - name: make check
run: | run: |
make check make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so run: arm-linux-gnueabihf-strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-linux-arm name: build-linux-arm
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
build-linux-musl: build-linux-musl:
runs-on: ubuntu-latest runs-on: ubuntu-latest
container: container:
image: alpine:3.13 image: alpine:3.13
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
apk update apk update
apk add alpine-sdk ca-certificates apk add alpine-sdk ca-certificates
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-debug --prefix=$PWD/.libsodium-build run: ./configure --disable-debug --prefix=$PWD/.libsodium-build
- name: make - name: make
run: make run: make
- name: make check - name: make check
run: make check run: make check
- name: make install - name: make install
run: make install run: make install
- name: strip - name: strip
run: strip --strip-all .libsodium-build/lib/libsodium.so run: strip --strip-all .libsodium-build/lib/libsodium.so
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-linux-musl-x64 name: build-linux-musl-x64
path: .libsodium-build/lib/libsodium.so path: .libsodium-build/lib/libsodium.so
build-macos: build-macos:
runs-on: macos-latest runs-on: macos-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- name: configure - name: configure
run: ./configure --disable-debug --prefix=$PWD/.libsodium-build run: ./configure --disable-debug --prefix=$PWD/.libsodium-build
- name: make - name: make
run: make run: make
- name: make check - name: make check
run: make check run: make check
- name: make install - name: make install
run: make install run: make install
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: build-osx-x64 name: build-osx-x64
path: .libsodium-build/lib/libsodium.dylib path: .libsodium-build/lib/libsodium.dylib
pack: pack:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- build-windows - build-windows
- build-linux-glibc - build-linux-glibc
- build-linux-glibc-arm - build-linux-glibc-arm
- build-linux-glibc-arm64 - build-linux-glibc-arm64
- build-linux-musl - build-linux-musl
- build-macos - build-macos
container: container:
image: mcr.microsoft.com/dotnet/sdk:5.0 image: mcr.microsoft.com/dotnet/sdk:5.0
env: env:
@ -193,48 +192,48 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-win-x64 name: build-win-x64
path: .libsodium-pack/runtimes/win-x64/native/ path: .libsodium-pack/runtimes/win-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-win-x86 name: build-win-x86
path: .libsodium-pack/runtimes/win-x86/native/ path: .libsodium-pack/runtimes/win-x86/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-linux-x64 name: build-linux-x64
path: .libsodium-pack/runtimes/linux-x64/native/ path: .libsodium-pack/runtimes/linux-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-linux-arm64 name: build-linux-arm64
path: .libsodium-pack/runtimes/linux-arm64/native/ path: .libsodium-pack/runtimes/linux-arm64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-linux-arm name: build-linux-arm
path: .libsodium-pack/runtimes/linux-arm/native/ path: .libsodium-pack/runtimes/linux-arm/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-linux-musl-x64 name: build-linux-musl-x64
path: .libsodium-pack/runtimes/linux-musl-x64/native/ path: .libsodium-pack/runtimes/linux-musl-x64/native/
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: build-osx-x64 name: build-osx-x64
path: .libsodium-pack/runtimes/osx-x64/native/ path: .libsodium-pack/runtimes/osx-x64/native/
- name: Copy files - name: Copy files
run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/ run: cp AUTHORS ChangeLog LICENSE packaging/dotnet-core/libsodium.pkgproj .libsodium-pack/
- name: Create NuGet package - name: Create NuGet package
run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj run: dotnet pack -c Release .libsodium-pack/libsodium.pkgproj
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: nuget-package name: nuget-package
path: .libsodium-pack/bin/Release/*.nupkg path: .libsodium-pack/bin/Release/*.nupkg
build-test-binaries: build-test-binaries:
runs-on: ubuntu-latest runs-on: ubuntu-latest
needs: needs:
- pack - pack
container: container:
image: mcr.microsoft.com/dotnet/sdk:5.0 image: mcr.microsoft.com/dotnet/sdk:5.0
env: env:
@ -242,75 +241,74 @@ jobs:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v1
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: nuget-package name: nuget-package
path: .libsodium-pack/ path: .libsodium-pack/
- name: dotnet new - name: dotnet new
run: dotnet new console -n Tests -o .libsodium-test/ run: dotnet new console -n Tests -o .libsodium-test/
- name: dotnet add package libsodium - name: dotnet add package libsodium
run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack run: dotnet add .libsodium-test/Tests.csproj package libsodium -s $PWD/.libsodium-pack
- name: Copy files - name: Copy files
run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs run: cp -f packaging/dotnet-core/test.cs .libsodium-test/Program.cs
- name: dotnet publish linux-x64 - name: dotnet publish linux-x64
run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true run: dotnet publish -c Release -r linux-x64 --self-contained true -p:PublishTrimmed=true
working-directory: .libsodium-test/ working-directory: .libsodium-test/
- name: dotnet publish linux-arm - name: dotnet publish linux-arm
run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true run: dotnet publish -c Release -r linux-arm --self-contained true -p:PublishTrimmed=true
working-directory: .libsodium-test/ working-directory: .libsodium-test/
- name: dotnet publish linux-arm64 - name: dotnet publish linux-arm64
run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true run: dotnet publish -c Release -r linux-arm64 --self-contained true -p:PublishTrimmed=true
working-directory: .libsodium-test/ working-directory: .libsodium-test/
- name: Move Build Output - name: Move Build Output
run: | run: |
mkdir .libsodium-builds mkdir .libsodium-builds
mv .libsodium-test/bin/Release/net5.0/linux-arm/publish .libsodium-builds/linux-arm mv .libsodium-test/bin/Release/net5.0/linux-arm/publish .libsodium-builds/linux-arm
mv .libsodium-test/bin/Release/net5.0/linux-arm64/publish .libsodium-builds/linux-arm64 mv .libsodium-test/bin/Release/net5.0/linux-arm64/publish .libsodium-builds/linux-arm64
mv .libsodium-test/bin/Release/net5.0/linux-x64/publish .libsodium-builds/linux-x64 mv .libsodium-test/bin/Release/net5.0/linux-x64/publish .libsodium-builds/linux-x64
- uses: actions/upload-artifact@v2 - uses: actions/upload-artifact@v2
with: with:
name: test-builds name: test-builds
path: .libsodium-builds/* path: .libsodium-builds/*
run-test-binaries: run-test-binaries:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
needs: needs:
- build-test-binaries - build-test-binaries
env: env:
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1 DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: 1
strategy: strategy:
matrix: matrix:
arch: [x64, arm, arm64] arch: [x64, arm, arm64]
steps: steps:
- name: Set up build environment - name: Set up build environment
run: | run: |
export DEBIAN_FRONTEND=noninteractive export DEBIAN_FRONTEND=noninteractive
cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null cat <<-EOF | sudo tee /etc/apt/sources.list.d/multiarch.list >/dev/null
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal main restricted
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates main restricted
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal universe
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates universe
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal multiverse
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-updates multiverse
deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse deb [arch=armhf,arm64] http://ports.ubuntu.com/ focal-backports main restricted universe multiverse
EOF EOF
sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list sudo sed -i 's/deb h/deb [arch=amd64] h/g' /etc/apt/sources.list
sudo dpkg --add-architecture armhf sudo dpkg --add-architecture armhf
sudo dpkg --add-architecture arm64 sudo dpkg --add-architecture arm64
sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64 sudo apt-get update && sudo apt-get install -y qemu-user qemu-user-static libstdc++6:armhf libstdc++6:arm64
- uses: actions/download-artifact@v2 - uses: actions/download-artifact@v2
with: with:
name: test-builds name: test-builds
path: .libsodium-builds/ path: .libsodium-builds/
- name: Run ${{ matrix.arch }}
run: |
chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests
.libsodium-builds/linux-${{ matrix.arch }}/Tests
- name: Run ${{ matrix.arch }}
run: |
chmod +x .libsodium-builds/linux-${{ matrix.arch }}/Tests
.libsodium-builds/linux-${{ matrix.arch }}/Tests