use repo provisioning in the test config #86
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: Run tests | ||
on: | ||
pull_request: | ||
push: | ||
branches: | ||
- main | ||
workflow_dispatch: | ||
inputs: | ||
jobs: | ||
test: | ||
name: Run unit and integration tests | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Run Go tests | ||
run: go test ./... | ||
- name: Run integration tests | ||
run: | | ||
go install | ||
python3 tests/integration/test_archives.py | ||
container-test: | ||
name: Run provisioning in a container | ||
runs-on: ubuntu-latest | ||
matrix: | ||
image: [fedora ubuntu] | ||
container: | ||
container: | ||
image: femnad/fup:${{ matrix.image }}-ci | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup container | ||
run: | | ||
go install | ||
cd cmd | ||
go build -o fup-verify | ||
cp fup-verify ~/go/bin | ||
- name: Provision | ||
run: | | ||
~/go/bin/fup -f tests/config/test.yml -l 0 -n -b | ||
- name: Verify | ||
run: | | ||
~/go/bin/fup-verify -c tests/config/test.yml -f tests/config/verify-test.yml | ||
container-remote-config-test: | ||
name: Run provisioning in a container via a remote config | ||
runs-on: ubuntu-latest | ||
matrix: | ||
image: [fedora ubuntu] | ||
container: | ||
image: femnad/fup:${{ matrix.image }}-ci | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup container | ||
run: | | ||
go install | ||
cd cmd | ||
go build -o fup-verify | ||
cp fup-verify ~/go/bin | ||
- name: Get branch | ||
id: get-branch | ||
run: | | ||
event="${{ github.event_name }}" | ||
head_ref="${{ github.head_ref }}" | ||
ref_name="${{ github.ref_name }}" | ||
if [ "$event" = 'pull_request' ] | ||
then | ||
branch="$head_ref" | ||
else | ||
branch="$ref_name" | ||
fi | ||
echo "branch=${branch}" >> "$GITHUB_OUTPUT" | ||
- name: Provision | ||
run: | | ||
~/go/bin/fup -f https://raw.githubusercontent.com/femnad/fup/${{ steps.get-branch.outputs.branch }}/tests/config/test-remote.yml -l 0 -n -b | ||
- name: Verify | ||
run: | | ||
~/go/bin/fup-verify -c https://raw.githubusercontent.com/femnad/fup/${{ steps.get-branch.outputs.branch }}/tests/config/test-remote.yml -f tests/config/verify-test-remote.yml |